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++ dllexport

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Thu Apr 19, 2018 8:41 am    Post subject: C++ dllexport Reply with quote

I am trying to create a plugin for CE, in the declaration of the functions to be exported I do something like "BOOL __declspec(dllexport) __stdcall CEPlugin_GetVersion(PPluginVersion pv, int sizeofpluginversion)".
But there is a Problem, the exported symbol is not "CEPlugin_GetVersion", in fact the symbol is"?CEPlugin_GetVersion@@YGHPAU_PluginVersion@@H@Z".
How to make Visual Studio 2017 export the symbolos correctly?

_________________
...
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Apr 19, 2018 8:51 am    Post subject: Reply with quote

1: You can name you sourcefile xxx.C instead of xxx.CPP
2: you can use a .def file to define the exports
3: (easiest) project properties->advanced->compile as->"compile as c code"

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Apr 19, 2018 9:00 am    Post subject: Reply with quote

4: use extern "C" { }
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Thu Apr 19, 2018 9:27 am    Post subject: Reply with quote

I tried to do step 1 and 4. But what I got now is that after the function name appears @x.
Example CEPlugin_GetVersion @ 8, where 8 is the number of bytes that the parameters of the function occupy.

_________________
...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Apr 19, 2018 9:49 am    Post subject: Reply with quote

MSDN Documentation on C name mangling

Use a .def file.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Jonathanzz
My life is CEF
Reputation: 0

Joined: 25 Apr 2018
Posts: 16777215

PostPosted: Wed Apr 25, 2018 2:35 am    Post subject: Reply with quote

Thanks for the reply.
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