?
Solved

Passing PChar to DLL

Posted on 2004-09-02
4
Medium Priority
?
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 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