| View previous topic :: View next topic |
| Author |
Message |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Wed Sep 19, 2007 10:06 am Post subject: [C/C++] A problem with exporting functions from a DLL.. |
|
|
Hey
I'm trying to export a function from my dll with "__declspec(dllexport)", but there is this wierd problem..
This is the prototype of my function in the dll:
| Code: | | __declspec(dllexport) BYTE __stdcall ListProcesses(void* CallbackFunction) |
I tried to use it with an exe, but it tells me that there isn't a function called "ListProcesses". I used a program called "DLL Export View" that shows me what functions are in a dll, and it shows me that the function called "ListProcesses@@YGEPAX@Z?". o_O
What the hell is wrong here? I want my function to have a normal name..[/code]
|
|
| Back to top |
|
 |
kittonkicker I post too much
Reputation: 1
Joined: 19 Apr 2006 Posts: 2171
|
Posted: Wed Sep 19, 2007 10:55 am Post subject: |
|
|
a .def file should fix your problem!
_________________
All gone  |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Wed Sep 19, 2007 10:56 am Post subject: |
|
|
That is a C++ export, C++ needs to put the type, parameters (function overloading), namespace etc in the name. Unfortunately there isn't a standard so implementations will change between compilers.
Solution without .def? Import by Ordinal! (see loadlibrary msdn page on instructions to do that)
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Thu Sep 20, 2007 12:12 am Post subject: |
|
|
Thanks, I made myself a .def file, problem solved
|
|
| Back to top |
|
 |
|