|
-
October 20th, 1999, 02:55 PM
#1
Call own dll.
I was trying to use the dll that is not standart
Win API dll. The function that I try to use
declared as following.
int FileVersion(char *filename)
And here is how I declared it in my VB project
Declare Function D3FileVersion
Lib "d3libshr" (Buffer as string)
as Integer
And here is the error that I got
"Bad DLL calling convention" ERRor 49
Please tell me that doe this error mean.
thks
Alex!
-
October 20th, 1999, 11:36 PM
#2
Re: Call own dll.
I don't think a C charcter pointer translates to a VB string. However, I don't really know what it would translate to. I would try changing "as string" to "as any" and see how that goes.
I think that the best translation for a character pointer is a byte array, so if as any doesn't work, try changing the variable to a byte array.
C experts, help me out here -- I'm just throwing out the hacks I would try, don't know if they'll work.
Charlie Zimmerman
http://www.freevbcode.com
Charlie
-
October 21st, 1999, 01:40 AM
#3
Re: Call own dll.
you should declare the string like this
( byval s as string )
then, in a 32 bit DLL an int is 4 bytes. Thus you should declare the returncode of your function "As Long".
-
October 21st, 1999, 11:40 AM
#4
Re: Call own dll.
It seams like byVal is the critical thing here.
And although it generate the error it does do the
job it suppose to do. I am trying to see why it
doing that but it works!!!!!!!!!!!
Thks!
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
|