okies.
basically there is two stages
first one is easy (for anyone else trying to compile it with a non-ms compiler) using __dclspec(dll_export) won''t export the functions completely as MSVC mangles standard calls.
Adding _stdcall (single _) makes it safe.
This lets the dll export functions work so they can call the functions between MSVC and other compiler DLL files.
Thats the first one.
After that GDARENA can call the functions (such as asking for the core function) without GDARENA saying it can''t find it (similar to running an old version of the bot).
The second part is what I am still trying to work around.
One of the functions in the BOT.DLL that is called by GDARENA.EXE sends is
extern "C" int LINKAGE QueryBotInterface(const char *iid, IPlayer **iptr){ *iptr = dynamic_cast(new SampleBot); return (*iptr != NULL);}
iptr is the data for the Bot that is given back to GDARENA (that or its doing bugger all when it gets there
![](smile.gif)
) that is used by the program for transferring data etc.
Anyway, with shared memory (I researched the problem, but I don''t know of a work around) according to the microsoft Win32 SDK, MS website, Borland documentation and a bunch of websites, shared memory between DLLs has to be used by using a varialble defined with either __export or __declspec(dllexport) if another program is to use it. passing pointers creates problems unless both were written in MSCV. I know borland protects it, and I think most of the others do too unless they use the MSMM which doesn''t do this. some security thing. I read that one of the free compilers is able to get around thing (MING or something) but I have no idea if it can be done with borland.
I''ve also tried code similar to what follows (not cut and pasting - different machines)
IPlayer __declspec(DLL_EXPORT) *player_ex;extern "C" int LINKAGE QueryBotInterface(const char *iid, IPlayer **iptr){ player_ex=dynamic_cast(new SampleBot); *iptr = player_ex; return (*iptr != NULL);}
Something along those lines anyway.
Basically definning the player data player_ex using an export the way it has in an example in the MS W32 SDK and the Borland Builder DLL help files, then sticking its address in the iptr pointer.
Results are the same in the end, GDARENA locks up and XP asks me to send an error report to microsoft (yes I know I can disable it, but I can''t be stuffed).
Anyway, thats the problem as it stands now. If anyone who has found a way of letting other programs access non-shared memory, I would be quite happy to find out how
![](smile.gif)
I''m nearly completely stumped.
![](smile.gif)
Anyway, back to fiddling with it. never know, it may work this time round.
Seeya later