Base Classes in .exe, derived classes in .dll

Discussion in 'C++' started by Colin Goudie, Jan 21, 2004.

  1. Colin Goudie

    Colin Goudie Guest

    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
     
    Colin Goudie, Jan 21, 2004
    #1
    1. Advertising

  2. Colin Goudie

    Jack Klein Guest

    On Wed, 21 Jan 2004 22:27:12 +1100, "Colin Goudie"
    <> wrote in comp.lang.c++:

    > 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
    news:comp.os.ms-windows.win32.programmer or one of Microsoft's support
    groups in the news:microsoft.public.vc.* 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.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Jan 22, 2004
    #2
    1. Advertising

  3. Colin Goudie

    Frank Puck Guest

    "Colin Goudie" <> wrote in message
    news:400e6211$0$1750$...
    > 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.
     
    Frank Puck, Jan 25, 2004
    #3
  4. "Frank Puck" <> wrote...
    >
    > "Colin Goudie" <> wrote in message
    > news:400e6211$0$1750$...
    > > 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.


    This statement is (a) incorrect and (b) off-topic.
     
    Victor Bazarov, Jan 25, 2004
    #4
  5. Colin Goudie

    Ron Natalie Guest

    "Frank Puck" <> wrote in message news:b7YQb.17204$...

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

    Not true.
     
    Ron Natalie, Jan 25, 2004
    #5
  6. Colin Goudie

    Frank Puck Guest

    "Ron Natalie" <> wrote in message
    news:40144fa3$0$222$...
    >
    > "Frank Puck" <> wrote in message

    news:b7YQb.17204$...
    >
    > >
    > > on Windows you cannot export symbols from an executable.
    > > You may only export symbols from a dll.
    > >

    > 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)...
     
    Frank Puck, Jan 26, 2004
    #6
  7. "Frank Puck" <> wrote...
    >
    > "Ron Natalie" <> wrote in message
    > news:40144fa3$0$222$...
    > >
    > > "Frank Puck" <> wrote in message

    > news:b7YQb.17204$...
    > >
    > > >
    > > > on Windows you cannot export symbols from an executable.
    > > > You may only export symbols from a dll.
    > > >

    > > Not true.

    >
    >
    > please enlighten me about how?


    Please post your Windows questions to a Windows newsgroup.
     
    Victor Bazarov, Jan 26, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. qazmlp
    Replies:
    1
    Views:
    577
    qazmlp
    Apr 10, 2005
  2. Replies:
    4
    Views:
    427
    Alf P. Steinbach
    May 23, 2007
  3. Replies:
    1
    Views:
    405
    myork
    May 23, 2007
  4. Replies:
    1
    Views:
    395
    Victor Bazarov
    May 23, 2007
  5. Replies:
    2
    Views:
    721
Loading...

Share This Page