load a Class from a DLL ?
Is it possible with Visual Studio .Net to put a Class in a DLL and instance it an other executable ??? If it is possible at runtime, it it time consuming ? Can me apply this method to load every kind of object a game can use ? (CModel CSolidModel CSoundGenerator CSoundEnvironment ...)
I know it''s possible with C++, and $100 says it''s possible with any .net languages as well.
MindEngine Development
http://medev.sourceforge.net
MindEngine Development
http://medev.sourceforge.net
Sure you can, just declare the class with __declspec(dllexport) in the dll and __declspec(dllimport) in the executable. I''m not sure how time consuming it is, but I expect its not too much of a performance hit.
Do you want to dynamically load it or use an import library?
If you want to do an import library, use what Duke said.
If you want to do it dynamically, you can do it with abstract interfaces
If you want to do an import library, use what Duke said.
If you want to do it dynamically, you can do it with abstract interfaces
I normally use COM-style interfaces. (Otherwise your DLL will likely be exporting a zillion member functions from all the classes)
It shouldn''t be too time consuming (for modern processors).
It shouldn''t be too time consuming (for modern processors).
There are a few ways of doing it. So yes, it is posible.
Maega advice works well. And if you go for the Abstract interfaces, then I can atest that it works, even when a C++ DLL is loaded by a Delphi App.
Armand
-------------------------
It is a good day to code.
Maega advice works well. And if you go for the Abstract interfaces, then I can atest that it works, even when a C++ DLL is loaded by a Delphi App.
Armand
-------------------------
It is a good day to code.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement