468,512 Members | 1,423 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

convert .exe to dll

Hi all

My task is to convert .exe (Windows Application like MS Paint) into a dll. The application is build using MFC and it includes lot of files afx....h and implements message map functions. There are a lots of classes derived from classes in afx....h.
Any steps and guidance as how should I proceed is highly appreciated.
I am using Visual Studio .NET 2005 and VC++8.0.
I completely do not need the windows functionality just the functions inside that project.
Mar 10 '08 #1
2 8817
gpraghuram
1,275 Expert 1GB
Hi all

My task is to convert .exe (Windows Application like MS Paint) into a dll. The application is build using MFC and it includes lot of files afx....h and implements message map functions. There are a lots of classes derived from classes in afx....h.
Any steps and guidance as how should I proceed is highly appreciated.
I am using Visual Studio .NET 2005 and VC++8.0.
I completely do not need the windows functionality just the functions inside that project.

The frst thing you need for a dll in windows is the .def file
This file says which functions are exposed from the dll.
You have to start from here.

Raghuram
Mar 11 '08 #2
weaknessforcats
9,207 Expert Mod 8TB
You will need to create a Win32 project to builf your DLL.

When you do this, a wizard will appear.

Do not click finish.

Instead, click application settings and then select DLL and empty project.

Now click finish.

Next, add you .cpp files to this project. When you build, you will have your DLL.

Pay attention to the previous post about the .DEF file. A DLL is a C relic and in C you ask for functions by name. C++ has function overloading which means the function names are "mangled" into a unique name used internally by C++. These "mangled" names will be in your DLL making it impossible for you to ask for the function by the C name. The .DEF file allows you to export the "mangled" name as a C function name.

Be sure to get a copy of Windows via C/C++ by Jeffrey Richter 2008. Starting on page 537 are about 180 pages about DLLs in Windows.

Good luck.
Mar 11 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

19 posts views Thread by Lauren Quantrell | last post: by
1 post views Thread by Logan X via .NET 247 | last post: by
3 posts views Thread by Convert TextBox.Text to Int32 Problem | last post: by
7 posts views Thread by patang | last post: by
4 posts views Thread by Edwin Knoppert | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.