Click here to Skip to main content
15,912,665 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I Use vs2008 to make my code in both debug and release,work well.But When I copy the .exe and the relative files(including MFC&CRT90 DLLs) to a different filefolder,it doesn't work! It demonstrate a ErrorDlg says"this application has requested the RunTime to terminate it....." AnyOne Help me!
Posted

It's no longer a good idea to copy the MFC and Run time DLLs willy nilly around with your program. Many of these DLLs are now registered and tracked through the manifest system.

Instead, use the the appropriate runtime installer for the version of Visual Studio you are using. This will make sure that the MFC and runtime DLLs you need are properly loaded with their dependancies, and properly registered.

Don't copy debug versions of your program to other systems. That will open up a big can of headaches for you. If you need to do remote debugging, then build your release code with debug info and link the remote debugger to your pdb files.
 
Share this answer
 
v2
Comments
xuebin_51207 11-Nov-11 8:53am    
thank you!I indirectly solved the problem by make a "setup" for the codes.It works well.Buf still I am puzzled a lot by the problem.
JackDingler 11-Nov-11 10:08am    
A lot of folks are puzzled by the complex manifest technology that Microsoft now integrates with their OS's.

You'll become more comfortable with it over time.
There can actually be a number of reasons for this. Most often it's a missing resource e.g. dll, program document, data files, or whatever your program depends upon. It can also happen because the program writes static paths to the registry or .ini file, making it an installation error.

Without knowing more of your program, it's hard to give explicit pointers.
 
Share this answer
 
Comments
xuebin_51207 10-Nov-11 7:30am    
I have "insert" operation to a .mdb file in my code, and i trace my code by and ::messagbeBox() in my code,I found just around the "insert" code,that corrupt.But what puzzled me is why in release file,it work well? copied to another filefolder it corrupt!
Niklas L 10-Nov-11 7:33am    
How do you give the path to the mdb-file? Something there maybe (?)
xuebin_51207 10-Nov-11 7:39am    
GetModuleFileNameA() I used this func to find the .exe path and replace "...exe" with "...mdb", and my logic is : if the specific .mdb file is not existing,i create it.'cause it will record my whole program infomation.
It can happen for lots of reason, if you are sure that all of your required dlls are there(Even though if it was because of missing dlls then it would be another error) then check for your miss use of dynamic memory.

as example
you may have a text box that receive text. then you move text from that text box to another char array. say the length of char array is x. Its a common mistake that every time you test your code you insert data smaller than length x, but may be when you started to insert real data then you are putting more than length x, it happens a lot.
 
Share this answer
 
Comments
xuebin_51207 11-Nov-11 8:54am    
thank you for your Solution! I will check my code!
Try compiling your code as Static

("Use MFC in Static Library" option in Properties->Configuration->General->Use of MFC).

Your exe size will increase as all the shared code (dll) are getting included in your exe now.

If you still get the error, the problem should be with some of the APIs you are using in your project. (like API calls included in your exe is not available in the OS on which it is currently running).
 
Share this answer
 
Comments
xuebin_51207 11-Nov-11 8:56am    
I think the APIs cause the problem may related to ADO operations.But I am still in fog.
It is not a advised to work with debug version on stand alone mode.
To embed the application run dependencies embedded inside the executable try to compile your program on static mode.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900