Solved

Passing PChar to DLL

Posted on 2004-09-02
4
341 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
Comment Utility
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 500 total points
Comment Utility
hello
0
 
LVL 10

Expert Comment

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

Author Comment

by:adam_pedley
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now