Base Classes in .exe, derived classes in .dll

C

Colin Goudie

Hi,

I'm hacking around coding a 3D Engine and I'm stumped with a concept.

Currently my engine is in a dll and it contains interfaces such as
IRenderSystem, IRenderDriver etc.. that are extended by other dll's
depending on the Rendering API. (Such as OpenGL or Directx)
The engine has main classes such as HoogeEngine, LogManager etc.. that are
used by client code to operate the engine.

The client app is in an .exe. It basically statically links the dll by
linking to the Hooge.lib file and then instantates the engine like this

//Create the engine
Hooge::HoogeEngine engine;

//Create the test task
TestApplicationTask task;

engine.registerApplicationTask(task);
engine.go();


And we are away. This is all working perfectly. HOWEVER, I now would like to
change the structure so that the Engine is an .exe and the game is just
another plugin such as the rendering dll's. However, I now have issues with
incorrect dll usage and all the __desclspec(dllexport) __declspec(dllimport)
associated with my interfaces.

At the moment, the Interfaces in the engine and most of all the classes in
the engine including the engine class itself (HoogeEngine), are prefixed
with HOOGE_API which
is defined as __declspec(dllexport) in the Hooge.dll, but defined as
__declspec(dllimport) if included in the client app (.exe) or the rendering
dll's (.dll's).
I can see why as my engine is a dll and it needs to export stuff out, which
is imported into the exe!

What do I need to change though to change the engine to an .exe?? and the
client app to a dll??

Do I remove all the HOOGE_API prefixes off the engine classes as they are
now in the .exe? How does the dll's such as the rendering API's and the
Application dll extend from the
interfaces defined in the exe??

I'm lost

Thanks
 
J

Jack Klein

Hi,

I'm hacking around coding a 3D Engine and I'm stumped with a concept.

Currently my engine is in a dll and it contains interfaces such as
IRenderSystem, IRenderDriver etc.. that are extended by other dll's
depending on the Rendering API. (Such as OpenGL or Directx)
The engine has main classes such as HoogeEngine, LogManager etc.. that are
used by client code to operate the engine.

You need a Windows programming group like
or one of Microsoft's support
groups in the family. There is no such
thing as a DLL in the C++ language. This is a Microsoft non-standard
extension, and the language says nothing at all about how they work.
 
F

Frank Puck

Colin Goudie said:
I can see why as my engine is a dll and it needs to export stuff out, which
is imported into the exe!


on Windows you cannot export symbols from an executable.
You may only export symbols from a dll.
 
V

Victor Bazarov

Frank Puck said:
on Windows you cannot export symbols from an executable.
You may only export symbols from a dll.

This statement is (a) incorrect and (b) off-topic.
 
F

Frank Puck

Ron Natalie said:
Not true.


please enlighten me about how?
E.g. how can I link an DLL importing some symbols by specifying an EXE
exporting these symbols.
Maybe via email to avoid offending some people here (which do programming
without an underlying OS)...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top