Archived

This topic is now archived and is closed to further replies.

python_regious

Multiple DLL usage.

Recommended Posts

''Lo people, I''m having a little trouble here, and it''s most likely because of my inexperience with DLL''s. As it stands, there are 3 components to my game. I have my engine, in a dll, my application ( with the game loop ), and another dll, with the game code in it ( as a series of "entities", think of HL here ). Now, this is where the problem occurs. The application loads up the engine, initialises it, etc. It then loads the game dll, and passes it a pointer to my engine interface ( all ready created. ). The game DLL knows about this interface. However, this doesn''t work. Whenever the classes in the game dll try to use this interface, an unhandled exception error occurs in trying to read the portion of memory that this interfaces points. It isn''t 0xcdcdcdcd or 0x0000005, but is the actual value the pointer should be. Now, this makes me wonder, since the game dll didn''t explicitly load the engine dll, does this mean that it can''t use any of the methods therein? I''ve tried making the game dll load the engine dll aswell, ( but still using the pointer given to it by the application ), but this still didn''t work. To clarify on a few things: The game dll needs the engine dll; The application needs the engine dll and the game dll; The engine dll doesn''t need anything. Now, you may wonder why I haven''t just made the game dll load the engine dll, create it''s own interface and use that? Well, I want the game dll and the engine dll to be de-coupled. That is, I want to be able to unload the game dll, and load a different one without doing the same thing to the engine dll. In short, how can I make this work? I hope I''ve made myself clear, if not, tell me and I''ll try a little harder. Cheers, Phil. Death of one is a tragedy, death of a million is just a statistic.

Share this post


Link to post
Share on other sites

Well,

As i understand you have the game app (exe) then this app load the game(dll) but the game need the engine(dll). The app is not
using the engine. So the only one who need to load or link (.lib if your dll produces a lib file) with the engine is the game. And the app only need to load/link with the game.

This way if you change the game.dll you dont have to change the
app.


Share this post


Link to post
Share on other sites
No, you don''t quite understand.

I''m linking at runtime here, so no libs. Also, I want to be able to load a different game dll at runtime ( ie, if someone mods or something, load a different game dll ). I don''t want to shutdown the engine, and re-init the engine everytime this happens.

Death of one is a tragedy, death of a million is just a statistic.

Share this post


Link to post
Share on other sites