Can anyone here explain me what did I do wrong?
I'm creating a plugin for my engine right now. Here's how it works. I have a dll that will loaded by the main library. So while loading the dll, the dll calls the function addToList in the main library via singleton.
To add the device to the library's list of device.Code:void Core::addToList( Device* newDevice ) { mDeviceList.push_back( newDevice ); }
Now when I try to load it via this function
This pops up. Unhandled exception at 0x6098a116 (Engine.dll) in Game.exe: 0xC0000005: Access violation reading location 0x60fb967c.Code:void Core::Go() { std::vector<Device*>::iterator it; for( it=mDeviceList.begin(); it<mDeviceList.end(); it++ ) { (*it)->_initialise(); } }
I tried to call _initialize on the addToList function by using this function, and it works fine.
I don't know what did I do wrong. This is the first time I create some dll and library. I hope you understand what I'm trying to say.Code:void Core::addToList( Device* newDevice ) { newDevice->_initialise(); }
Thank you
Sarah22



LinkBack URL
About LinkBacks




Also, they usually use the same CRT (provided that the specific file requested is the same*); Windows loads a single copy into the shared address space (in fact, when relocation isn't necessary, that same copy is used by other processes, as well). The real problem lies in ABI incompatibilities, eg: the DLL was compiled with SGI's STL and the calling program was compiled with RogueWave's implementation, for example; the binary formats of the respective implementations may well be completely incompatible, and in that case, returning, say, an stl::list from your DLL obviously wouldn't work properly.