Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C/C++] A problem with exporting functions from a DLL..

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Wed Sep 19, 2007 10:06 am    Post subject: [C/C++] A problem with exporting functions from a DLL.. Reply with quote

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
View user's profile Send private message
kittonkicker
I post too much
Reputation: 1

Joined: 19 Apr 2006
Posts: 2171

PostPosted: Wed Sep 19, 2007 10:55 am    Post subject: Reply with quote

a .def file should fix your problem!
_________________
All gone Sad
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Wed Sep 19, 2007 10:56 am    Post subject: Reply with quote

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
View user's profile Send private message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Thu Sep 20, 2007 12:12 am    Post subject: Reply with quote

Thanks, I made myself a .def file, problem solved Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites