void Discord_Minecraft::launchCommande(ValueMap payload){ ptrBot->CreateMessage(ChannelLastMessage, "SmartUppBot DLL hot LOAD !"); //the crash occur here (the ptrBot addr is right) }
DiscordModule* test = facto(); //Test is my Discord_Minecraft DLL object test->ptrBot = getBotPtr(); // here I fill ptrBot
Someone have an idea ? maybe I can't share object between my Dll instance of object and my programm ?
Xemuth wrote on Thu, 01 August 2019 15:09
Someone have an idea ? maybe I can't share object between my Dll instance of object and my programm ?
Literally a lot of things can go wrong here. For starters, try to "USEMALLOC". Anyway, in general, sharing should work.
Mirek
req.New(); //req is HttpRequest Object, When I'm in debug mode, the crash occure here Json json("content", message); req.Url(baseUrl); // When I'm in release the crash occure here req.Path("/api/channels/" + channel + "/messages"); req.POST(); req.Post(json); String response =req.Execute(); LOG(response); ValueMap m = ParseJSON(response); ApplyRateLimits(req); LOG(req.GetContent());
extern "C" __declspec(dllexport) String __cdecl test(){ HttpRequest reqApi("https://chucknorrisfacts.fr/api/get?data=nb:1;type:txt;tri:alea"); reqApi.TRACE(); reqApi.GET(); ValueMap json = ParseJSON(reqApi.Execute()); if(~json[0]["fact"].GetCount()) return ~json[0]["fact"]; else return " Error "; }
Nobody have an idea ?:'(
String GetIniKey(const char *id, const String& def) { ASSERT_(IsMainRunning(), "GetIniKey is allowed only after APP_MAIN has started"); Mutex::Lock __(sMtx); return sIniKeys().Get(id, def); } bool IsMainRunning() { return sMainRunning; }
#include <Core/Core.h> using namespace Upp; int main(int argc, char *argv[]){ AppInit__(argc, (const char **)argv); ...
AppExit__(); return UPP::GetExitCode(); }