|
-
August 3rd, 2006, 10:00 PM
#1
A Win32 Dll Question
Dear All:
I using MFC 6.0 to build a "Win32 Dynamic Link Library", and output "a.dll, a.lib" files . The dll file exports functions to used.
After finished it , I use "a.dll a.lib a.h" in another MFC project and build an .exe file correctly(the exe file is build with "using MFC in static lib"). It works well in my OS , and I can use the .exe to control an instrument.
Problem occur:
If I use debug mode to create dll & lib file, and using the two files to buile the .exe file, it work will in my OS and another OS(the new OS doesn't install VC 6.0).
But if I use released mode to create dll & lib file, and using the two file to build .exe file, it's just work will in my OS, not in the new OS.
What is the problem!? Please help me~~ ><
-
August 4th, 2006, 12:59 AM
#2
Re: A Win32 Dll Question
Hi,
What do u mean by "It will not work in the other OS" ? Please check if you
have the same project settings for the "Release" build and the "Debug" build.
You might have forgotten to set the option "using mfc in static lib".
Secondly, if you dont want to do a static build, Run the "Depends" tool
a.k.a. "Dependency Walker" to identify the DLLs needed for your application.
Distribute the DLLs along with your application. Mostly, u just need to
distribute the MSVCRT.DLL and the MFC42.DLL along with your app.
-
August 4th, 2006, 02:19 AM
#3
Re: A Win32 Dll Question
Hi
Thank for your help! I build my project in computer A, and I copy the project generate .exe file and all need dll files to computer B(new OS install window2000 only).
The question I have meat is:
If I use debug mode to create dll & lib file, and using the two files to buile MFC .exe file, it work will in my OS and another OS(the new OS doesn't install VC 6.0).
But if I use released mode to create dll & lib file, and using the two file to MFC .exe file in the same project , it's just work will in my OS, not in the new OS.
The main UI doesn't appear in the screen, just pop up a message box say:
Program Error:
a.exe has generated error and will be close by Windows,You will need to restart your program.
What is the problem!?
2. I have try to build my dll file in "MFC App Wizard" using "regular dll with share MFC dll", it's work will in my OS and New OS whether the dll bulid condition.
Because the dll file export functions doesn't use MFC dll file, and the same dll file will be used in other language(like VB), so I want to build the dll file without MFC.
Anyway, thanks for your kindness help!
-
August 17th, 2006, 09:58 PM
#4
Re: A Win32 Dll Question
I have find the answer! There is a mistake in my program. Thanks ~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|