|
-
September 5th, 2001, 04:54 PM
#1
error: bad calling dll convention
hi you all doing
i have a dll defined like this in access module
Public Declare Function GenerateLicenceID Lib "C:\Final\bin\vproc.dll" Alias "?GenerateLicenceID@@YA?AVCString@@V1@H@Z" (sBaseID As String, duration As Integer) As String
than i have a function that calls it in one of the forms
Dim SerKey As String
Dim UnKey As String
Dim sTerm As Integer
sTerm = [Term].Value
SerKey = [Lic_Key].Value
UnKey = GenerateLicenceID(SerKey, sTerm)
[Unlock_Key].Value = UnKey
but as i run it i get bad calling dll convention
i use the alias feature because that is how it is called after exporting it in c++
-
September 5th, 2001, 07:29 PM
#2
Re: error: bad calling dll convention
1) R U sure as string the return value of API?
2) maybe that the function in lib is not declare as __stdcall...
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
-
March 21st, 2006, 11:03 PM
#3
Re: error: bad calling dll convention
YES!!! This post has helped me solved my problem. I forgot to put __stdcall after declspec(dllexport).
Thanks GetFree
-
March 21st, 2006, 11:41 PM
#4
Re: error: bad calling dll convention
 Originally Posted by MSDN
Warning If you change the function name, class, calling convention, return type, or any parameter, the decorated name is no longer valid. You must get the new version of the function name and use it everywhere the decorated name is specified.
"?GenerateLicenceID@@YA?AVCString@@V1@H@Z" is not guaranteed to remain the same. To get your function exported with an undecorated name you should use a *.def file in the C++ project building the dll.
Sample content of a *.def file:
Code:
; MyDLL.def
; The LIBRARY entry must be same as the name of your DLL
LIBRARY "MyDLL"
DESCRIPTION "What is my library doing"
EXPORTS
VisibleName1
VisibleName2=InternalName2
VisibleName3 @1
VisibleName4 @2 NONAME
Regards,
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
|