Extension DLL using classes defined in main app.

aryckw
aryckw used Ask the Experts™
on
Hi,
I have an MFC-based application that uses an extension DLL. The extension DLL exports a class(CExtensionClass) that is to be used in the main application(CMainApp).

If there is a class(CMyClass) defined in the main application project and I want to use it in the extension DLL, is that possible?

Right now if I include the "MyClass.h" header in the CExtensionClass.cpp file, everything compiles OK. When I create an object, myClassObj, then the compiler throws the "unresolved external symbol" errors.

Thanks for the help,
Eric
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Freelance programmer / Consultant
Commented:
Can't you put the other class into your dll (or another extension dll that both dll and app use)?

Or if you only need some of the functionality provide a base class in your dll and in the app the other class inherits from this base class.

Author

Commented:
Yes, that's what I will probably end up doing. I was hoping to avoid that situation, b/c it will re-structure the entire application into multiple, smaller projects.
AndyAinscowFreelance programmer / Consultant

Commented:
I think my suggestion would do what was initially asked for.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial