?
Solved

Passing PChar to DLL

Posted on 2004-09-02
4
Medium Priority
?
362 Views
Last Modified: 2006-11-17
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\EasySyncLib.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
0
Comment
Question by:adam_pedley
  • 2
  • 2
4 Comments
 
LVL 4

Author Comment

by:adam_pedley
ID: 11961603
Solved the problem

Public Declare Auto Function UploadKill Lib "C:\Program Files\EasyCheck\EasySyncLib.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

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
0
 
LVL 10

Accepted Solution

by:
prakash_prk earned 2000 total points
ID: 11961652
hello
0
 
LVL 10

Expert Comment

by:prakash_prk
ID: 11961653
Please deleted the question . post a request to community support .
Don't give points to anyone
0
 
LVL 4

Author Comment

by:adam_pedley
ID: 11961669
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
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question