DLLs and Inheritance

Started by
2 comments, last by Psybr 21 years, 8 months ago
Say you have two classes, CBaseClass and a derived class CDerivedClass. I want to export CDerivedClass into a DLL, but I''m not sure if I have to include CBaseClass in the DLL, or define it in the application, or what?
Advertisement
You''ll have to either include CBaseClass in the same DLL
or export to another DLL and have CDerivedClass''s DLL
reference it.


Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
So if I had two classes derive from the base class, would it be easier to rewrite the derived classes without inheritance, or to include the base class in a DLL? And how would I reference it in the DLLs of the derived classes?
Two ways I can think of:

CBaseClass.lib
CDerivedClass1.dll links with CBaseClass.lib
CDerivedClass2.dll links with CBaseClass.lib

or

CBaseClass.dll
CDerivedClass1.dll links with CBaseClass.lib (import lib)
CDerivedClass2.dll links with CBaseClass.lib (import lib)



Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!

This topic is closed to new replies.

Advertisement