-
inheritance in dll
i have to classes, WINDOW and BUTTON. they are both to be exported from the dll. also, both of these classes inherit from a class called WNDSKELETON.
when i compiled it gave me an error like this
Code:
warning C4275: non dll-interface class 'WNDSKELETON' used as base for dll-interface class 'CHILD'
i went on the msdn to look up the warning, and from what i understand, i have to export the WNDSKELETON class as well in order to avoid this warning. if i dont do it also get this error in my client:
Code:
struct HWND__ * __thiscall WNDSKELETON::GetHwnd(void)" (?GetHwnd@WNDSKELETON@@QAEPAUHWND__@@XZ)
when i use the function through one of the classes (WINDOW or BUTTON).
what if i dont want the user to be able to use WNDSKELETON directly?
should i just not use inheritance?
thanks in advance! :)
Amon Ra
-
1 Attachment(s)
ok i uploaded the project with all the classes to be exported..thanks to anybody who helps me..also i found out that for some reason, nothing happens when i try to create my window..
thanks again
-
Make all constructors of the base class protected. This will make it impossible to directly create an object of the base class because the constructor cannot be accessed. The derived classes still can call the constructor, so you can create objects of this classes.
-