|
-
Jan 28th, 2003, 10:32 AM
#1
Thread Starter
Lively Member
__declspec( dllexport ) - Calling from vb
I assumed that using __declspec( dllexport ) meant that I wouldn't have to use a .def file (according to msdn anyway!)
However a dll with __declspec( dllexport ) can still not be called from vb without a .def file.
Any ideas why...
From msdn
----------------------------
These attributes explicitly define the DLL's interface to its client, which can be the executable file or another DLL. Declaring functions as dllexport eliminates the need for a module-definition (.DEF) file, at least with respect to the specification of exported functions
-----------------------------
-
Jan 28th, 2003, 12:06 PM
#2
Frenzied Member
__declspec(dllexport) only exports the function. However, it mangles the function name as regular, while VB expects an unmangled function name. You need a def file to accomplish this.
Z.
-
Jan 28th, 2003, 08:26 PM
#3
So you can only use those functions with MSVC++-compiled C++.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 28th, 2003, 10:07 PM
#4
Frenzied Member
Originally posted by CornedBee
So you can only use those functions with MSVC++-compiled C++.
No exactly true... You CAN use GetProcAddress, or use the dll in VB, but instead of using the function name to get the address of the function, you have to use the MANGLED name instead. The def file only stops the mangling.
Z.
-
Jan 29th, 2003, 06:50 AM
#5
Have fun using mangled C++ names...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 29th, 2003, 09:38 AM
#6
Frenzied Member
Originally posted by CornedBee
Have fun using mangled C++ names...
Its not a big deal, you can look at them using the Dependency Walker 
Z.
-
Jan 29th, 2003, 05:16 PM
#7
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 30th, 2003, 06:27 AM
#8
Thread Starter
Lively Member
Thanks for the clarification.
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
|