Home » Community » Coffee corner » [SOLVED]Sharing Ptr of object to dll
[SOLVED]Sharing Ptr of object to dll [message #52172] |
Thu, 01 August 2019 15:09  |
 |
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
Hello community,
I have a programm wich load a dll. This dll carry class wich have a public attribut "object* object;"
this public attribut is fill by my main programm like that: ptrToTheClass->object = myMainObjectPtr;
then when I use method of my dll wich use the objectDll ptr it crash.
However my objectDll Ptr have the right address of the main object so I dont get why it crash.
(I have checked by using log and the problem occur when I call method of ptrToTheClass->object)
Someone have an idea ? maybe I can't share object between my Dll instance of object and my programm ?
here I show you :
Method of my dll:
void Discord_Minecraft::launchCommande(ValueMap payload){
ptrBot->CreateMessage(ChannelLastMessage, "SmartUppBot DLL hot LOAD !"); //the crash occur here (the ptrBot addr is right)
}
here is creation of Discord_Minecraft object and filling of ptrBot :
DiscordModule* test = facto(); //Test is my Discord_Minecraft DLL object
test->ptrBot = getBotPtr(); // here I fill ptrBot
Thanks in advance.
Best Regard.
[Updated on: Wed, 07 August 2019 09:53] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 10 21:46:18 CEST 2025
Total time taken to generate the page: 0.03539 seconds
|