DLL Class Headers

Hey guys,

I just have a general question about the standard for exporting classes and members from a DLL. Is it customary to use one header for all the class prototypes that are in the DLL? For example, say I have ClassA.h, ClassA.cpp, and MyDLL.h(What I would include in another project). Do I just take everything from ClassA.h and shove it into MyDll.h and get rid of ClassA.h? I guess it would be more ideal for me to have seperate header files for each class, but that would mean I would have to include those in any project that uses the DLL. Any suggestions for what I should do?

Thanks!
closed account (S6k9GNh0)
No, you keep MyDLL.h the way it is and you should almost never edit it unless it's broken or your adding functionality inside of the DLL itself. Simply include MyDLL.h in your current project and call it's functions from there. So it would go from ClassA.cpp which includes ClassA.h and MyDLL.h or ClassA.h which includes MyDLL.h. Depends on the structure your looking for or depending on.
Sorry, I think you misunderstood. I am creating the DLL. ClassA resides inside it and i want to export it for use in my other project.
you can include all your headers in MyDll.h and then your other projects can include MyDll.h only... you dont have to include other headers.

export the classes which are in ClassA.h.
Ok, I got it working that way. I was having errors before which made me think I had to combine all the header files, but it turned out to be something with the PCH. Anyhow, thanks for your help.
Topic archived. No new replies allowed.