Link to home
Start Free TrialLog in
Avatar of horn
horn

asked on

Converting from EXE to DLL

I have two executables which I would like to convert to DLLs. Currently the first executable creates a window for
text input and the second creates a window for drawing input. I would like to write another application that will
display either the writing or the drawing window in response to a switch. Therefore the new application will have to create and display the writing and drawing windows, using CreateWindow (I think).

I know that I can create a new project as a DLL and import my classes. Do I have to create a MFC DLL or can I just create a Win32 DLL project and copy the code directly? How do I get my classes to be registered so I can use CreateWindow?

I will increase the number of points if it is necessary.

ASKER CERTIFIED SOLUTION
Avatar of motigust
motigust

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of horn
horn

ASKER

What should I do about importing resources?
I'm not sure I understood what you ment..
When you are creating a MFC DLL using the wizard, it is created with a resource file, you may put all your resources there. So, you may use your resources the same way that you are using them now.

But again, remember to put the
AFX_MANAGE_STATE(AfxGetStaticModuleState());
at the begining of each function that uses the resources.

Avatar of horn

ASKER

OK, I understand what you mean about the resources -- that in itself answered my question! Thanks.