|
-
January 29th, 1999, 07:31 AM
#1
URGENT - How to pass a string to a DLL ??
I have written a DLL using Win32 SDK . One of the exported functions in DLL takes LPCTSTR as parameter. How do I call this from VB ? If I pass a variable of type String , it gives a "Bad DLL Calling convention" error.
Help is very much appreciated
Thanks
Anand
-
January 29th, 1999, 01:03 PM
#2
Re: URGENT - How to pass a string to a DLL ??
You have to pass the string to the dll ByVal So try this
Private Declare Function MyFunction_
Lib "MyDLL" Alias "MyDLLFunction" ( _
ByVal lpBuffer As String )
This should work.
-
January 29th, 1999, 11:29 PM
#3
Re: URGENT - How to pass a string to a DLL ??
Hi Hemant
I had given the same way as you had mentioned. I didn't give an alias.
I have a function named ExecuteCommand1 in my Dll . I have given it like this
Public Declare Function ExecuteCommand1_
Lib "Path of the Dll" ( _
ByVal lpBuffer As String )
It gives the same error " Bad DLL calling convention"
Anand
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|