Runtime linking

B

Ben

Hi all,

I'm relatively new to C++ and have a quick question concerning a
better way to perform runtime linking. Currently a client wishes to
create a class in a .dll. I export 2 methods from my dll to assist in
this called create(IBase**) and delete(IBase**). The IBase interface
exists in both client and .dll, but in the .dll there is also an
implementation of the IBase interface called CExtendsBase. The problem
is now I want to add more and more classes to my .dll, and I see that
I'm going to have to export a create() and delete() function for each
interface. Is there a more elegant way of doing this? Bear in mind
that I'm currently compiling the code in MSVC++ but intend to have it
be portable to Linux at some point in the future.

Any ideas would be much appreciated.

Ben.
 
J

Jack Klein

Hi all,

I'm relatively new to C++ and have a quick question concerning a
better way to perform runtime linking. Currently a client wishes to
create a class in a .dll. I export 2 methods from my dll to assist in
this called create(IBase**) and delete(IBase**). The IBase interface
exists in both client and .dll, but in the .dll there is also an
implementation of the IBase interface called CExtendsBase. The problem
is now I want to add more and more classes to my .dll, and I see that
I'm going to have to export a create() and delete() function for each
interface. Is there a more elegant way of doing this? Bear in mind
that I'm currently compiling the code in MSVC++ but intend to have it
be portable to Linux at some point in the future.

Any ideas would be much appreciated.

Ben.

You need to ask about this in a Windows programming group, it is not a
C++ language issue. C++ does not define or support runtime linking or
dynamic libraries, this is all OS and compiler specific.

--
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++ ftp://snurse-l.org/pub/acllc-c++/faq
 

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,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top