adam_pedley
asked on
Passing PChar to DLL
Hi
I have a DLL that was created in Delphi. I am using vb to call a function in this DLL.
The function asks for PChar of the filename that it will use. I pass a string to the DLL and the DLL brings up a window and says uploading file c to destination when the string i entered was c:\test.txt. It only gets the first character.
Here is the source code i have used
Public Declare Auto Function UploadKill Lib "C:\Program Files\EasyCheck\EasySyncLi b.dll" Alias "UploadKillFile" (ByVal Filename As String, ByVal userid As String, ByVal pword As String, ByVal status As String, ByVal maxlength As Integer) As String
and then
dim str as String = "c:\test.txt"
UploadKill(str, "", "", "", 255)
and yes i have tried byRef filename as string
thanks
I have a DLL that was created in Delphi. I am using vb to call a function in this DLL.
The function asks for PChar of the filename that it will use. I pass a string to the DLL and the DLL brings up a window and says uploading file c to destination when the string i entered was c:\test.txt. It only gets the first character.
Here is the source code i have used
Public Declare Auto Function UploadKill Lib "C:\Program Files\EasyCheck\EasySyncLi
and then
dim str as String = "c:\test.txt"
UploadKill(str, "", "", "", 255)
and yes i have tried byRef filename as string
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please deleted the question . post a request to community support .
Don't give points to anyone
Don't give points to anyone
ASKER
put i want to keep this question up, so that if other people have the same problem they can see my solution
i'm on premium services anyway, so i have unlimited points
i'm on premium services anyway, so i have unlimited points
ASKER
Public Declare Auto Function UploadKill Lib "C:\Program Files\EasyCheck\EasySyncLi
Changed the auto to ansi and it worked
its always a small change that makes a big difference
First person to say hello on this question gets the 500 points