Developed by UGProgramMostly DLL, the main ug process should be started during debugging. In the past, the actual attribute command specified the ug EXE, but the debug exited the ug, which is very inconvenient. How slow is it to start ug! Therefore, I studied how to disable ug after debugging.
In general, the idea is to inject the developed DLL into the ug process space, instead of actively starting the ug main process, so that the main process can be uninstalled without being closed after debugging.
There are two debugging methods for the injection process. First, there are two preparations. First, loading is manual. If the uninstallation method is immediate (C) or manual (C ++), do not let the DLL unmount at the end of UG. Second, use exception capture or other methods. Otherwise, an error may occur and the process may be killed. Of course, UG is doing well. Even if an error occurs, it will not quit.
In addition, this article focuses on the internal mode, where the language is C or C ++. In fact, the same is true for. net. I will not repeat it here. If you are free, develop. Net again.
Body start:
1. ug nx4, injection method during debugging. Nx4 can only be like this, And nx5 can be set in the property. Nx4 uses vs2003
1. Set breakpoints in the program and debug the compilation mode.
2. Set the uninstall method, as mentioned earlier
3. Start ug or ug is running.
4. Find the Debug menu in vs2003 and select process]
5. Select ugraf.exe and click Add]
6. Check the "native" program type. to add more information, select the CLR type for the. NET program.
7. Start debugging in Vs and load the DLL in UG,
8. Enable vs2003 debugging.
9. After debugging, select "all separation" or "Stop debugging" in the "debug" menu. You can study the differences between the two.
10. Finally, do not forget to uninstall the DLL in UG if you set it manually.
Ii. ug nx5 and vs2005. use the method set in the project attribute. Of course, this can also be the same as above.
1. Set breakpoints in the program and debug the compilation mode.
2. Set the uninstall method, as mentioned earlier
3. Start ug or ug is running.
4. Set the project property page in vs2005,
5. In the includebuggingdeletion in [configuration propertydeletion, specify the commander's ugraf.exe, including the path
Select "Attach" as yes. In addition, the same applies to. net programs.
6. Start debugging.
7. Load the DLL in UG,
8. Enable vs2003 to debug it.
9. After debugging, select "all separation" or "Stop debugging" in the "debug" menu. You can study the differences between the two.
10. Finally, do not forget to uninstall the DLL in UG if you set it manually.
That's clear enough. I have captured images, but you may also know that it is very painful to upload images through csdn.
Reply if any problem occurs.