Importing Classes from DLLs
Posted on 2000-04-26
I want to define a class and its members in a DLL and then export the class so that I may use the class in another application. I have exported the class using __declspec(dllexport) macro in a regular DLL(not extension DLL - the class is not derived from any of the MFC classes).
Now, I link the the DLL in a different application thru its .lib file and import the class using the __declspec(dllimport) macro. The catch is, I am not able to create objects of the imported class unless I dont include the header file from the dll in which the class is defined. How do I create objects of a class exported from a DLL without using the .h file? - u see, i only want to ship the DLL and the LIB file for the exported class.