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-users/attachments/20080509/4b1f3352/attachment.htm
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.
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* > > ------------------------------------------------------------------------ > > >
Dan Kegel wrote:> On Sat, May 10, 2008 at 9:16 AM, vitamin <wineforum-user at winehq.org> 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. > - DanThen one can always use GetProcAddress().
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.