VB6 and wine_get_unix_file_name

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Escuder Nicolas

VB6 and wine_get_unix_file_name

Post by Escuder Nicolas »

Hello,



I'm trying to make a function for using wine_get_unix_file_name in VB6
programs.



Private Declare Function lstrcpyA Lib "kernel32.dll" (ByVal lpString1 As
String, ByVal lpString2 As Long) As Long

Public Declare Function GetProcessHeap Lib "kernel32" () As Long

Public Declare Function HeapFree Lib "kernel32" (ByVal hHeap As Long, ByVal
dwFlags As Long, IpMem As Any) As Long

Public Declare Function wine_get_unix_file_name Lib "kernel32" (ByVal
lpszSrc As String) As Long



Public Function GetUnixPath(ByVal sPath As String) As String

Dim ptr As Long

Dim sBuffer As String * 255

ptr = wine_get_unix_file_name(StrConv(sPath, vbUnicode))

lstrcpyA sBuffer, ptr

HeapFree GetProcessHeap(), 0, ByVal ptr

GetUnixPath = sBuffer

End Function



Sub Main()

UnixPath = GetUnixPath()

MsgBox UnixPath

End usb



When running this code I got a blank msgbox can anyone help me please.



See you.



Escuder Nicolas





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-us ... chment.htm
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: VB6 and wine_get_unix_file_name

Post by vitamin »

Escuder Nicolas wrote:I'm trying to make a function for using wine_get_unix_file_name in VB6 programs.
That is Wine internal function - don't use it.
Dan Kegel

VB6 and wine_get_unix_file_name

Post by Dan Kegel »

On Sat, May 10, 2008 at 9:16 AM, vitamin <[email protected]> wrote:
Escuder Nicolas wrote:
I'm trying to make a function for using wine_get_unix_file_name in VB6 programs.
That is Wine internal function - don't use it.
I suppose alternately one could run winepath.

But we do export that function from kernel32, so it's not
*that* internal. And IIRC we use that function in Picasa
to hide the DOS drive letters. So I think I support Escuder's
idea.
- Dan
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: VB6 and wine_get_unix_file_name

Post by vitamin »

Dan Kegel wrote:On Sat, May 10, 2008 at 9:16 AM, vitamin <[email protected]> wrote:
Escuder Nicolas wrote:
I'm trying to make a function for using wine_get_unix_file_name in VB6 programs.
That is Wine internal function - don't use it.
I suppose alternately one could run winepath.

But we do export that function from kernel32, so it's not
*that* internal. And IIRC we use that function in Picasa
to hide the DOS drive letters. So I think I support Escuder's
idea.
- Dan
Then one can always use GetProcAddress().
Dan Kegel

VB6 and wine_get_unix_file_name

Post by Dan Kegel »

On Sat, May 10, 2008 at 12:35 PM, vitamin <[email protected]> wrote:
But we do export that function from kernel32, so it's not
*that* internal. And IIRC we use that function in Picasa
to hide the DOS drive letters.
Then one can always use GetProcAddress().
Right, that's what Picasa does, I think.
And it's what Escuder is trying to do with VB. He's just
having a little trouble getting it working.
- Dan
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: VB6 and wine_get_unix_file_name

Post by vitamin »

Dan Kegel wrote:Right, that's what Picasa does, I think.
And it's what Escuder is trying to do with VB. He's just
having a little trouble getting it working.
Well this is Wine forum not VB forum. What I suggested works perfectly for me in C programs.
Dan Kegel

VB6 and wine_get_unix_file_name

Post by Dan Kegel »

On Sat, May 10, 2008 at 2:48 PM, vitamin <[email protected]> wrote:
And it's what Escuder is trying to do with VB. He's just
having a little trouble getting it working.
Well this is Wine forum not VB forum. What I suggested works perfectly for me in C programs.
Vitamin, you have to cut the bad attitude.
We shouldn't discriminate against people trying to
ask Wine-specific questions just because of the language they choose to use.
James McKenzie

VB6 and wine_get_unix_file_name

Post by James McKenzie »

vitamin wrote:
Dan Kegel wrote:
Right, that's what Picasa does, I think.
And it's what Escuder is trying to do with VB. He's just
having a little trouble getting it working.
Well this is Wine forum not VB forum. What I suggested works perfectly for me in C programs.

Acutally, this belongs in a developer forum, not a Users forum according
to my logic, but you have to be willing to assist those who use a
language other than your favorite. BTW, VB is used in industry for some
heavy duty programs (of which I have signed NDAs for in order to get an
interview.) The question and problem are legit, so if you cannot help
someone with the problem then let others.
BTW, I would suggest to the OP of this problem to look in a good VB book
to see how to convert a c call into a VB call.

James McKenzie
Marcelo Duarte

VB6 and wine_get_unix_file_name

Post by Marcelo Duarte »

UnixPath = GetUnixPath() needs a parameter...

Escuder Nicolas escreveu:
Hello,

I’m trying to make a function for using wine_get_unix_file_name in VB6
programs.

Private Declare Function lstrcpyA Lib "kernel32.dll" (ByVal lpString1
As String, ByVal lpString2 As Long) As Long

Public Declare Function GetProcessHeap Lib "kernel32" () As Long

Public Declare Function HeapFree Lib "kernel32" (ByVal hHeap As Long,
ByVal dwFlags As Long, IpMem As Any) As Long

Public Declare Function wine_get_unix_file_name Lib "kernel32" (ByVal
lpszSrc As String) As Long

Public Function GetUnixPath(ByVal sPath As String) As String

Dim ptr As Long

Dim sBuffer As String * 255

ptr = wine_get_unix_file_name(StrConv(sPath, vbUnicode))

lstrcpyA sBuffer, ptr

HeapFree GetProcessHeap(), 0, ByVal ptr

GetUnixPath = sBuffer

End Function

Sub Main()

UnixPath = GetUnixPath()

MsgBox UnixPath

End usb

When running this code I got a blank msgbox can anyone help me please.

See you.

*Escuder Nicolas*

------------------------------------------------------------------------

Locked