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*
------------------------------------------------------------------------