About VC Operations Excel cannot quit a process issue

Source: Internet
Author: User

On-line search for a long time have no results, the same problem is quite a lot, are not resolved, and some end process to solve the way. Although I did not completely solve, but may be able to help meet the same problem of friends, the operation of Excel in the thread is not a problem, the process of the completion of the threads will be exited, of course, in-line add:: CoInitialize (NULL),:: CoUninitialize () To initialize the thread COM library, what if it's not a thread? For example, in a button event, the problem is that in this case, the Excel process will be clicked one more time, the event execution end process will not exit. The way I do this is to add a WM_CLOSE message:: CoUninitialize (), so although the surface seems to be executed one more process, but in the exit will be all the Excel process exits, some people say this still use you say Ah! And listen to me go on, I used the DoModal (), in this interface added a button event within the save Excel, without adding: couninitialize () in case of closing DoModal (), the Excel process will not quit, Excel will not exit after the entire program is exited, and when DoModal () is closed add:: CoUninitialize (), close DoModal () will exit the Excel process created in DoModal (), no matter how many will exit. If you want to exit Excel after executing the code, then it is recommended that you use threads to do it! If there is a better way to quit Excel without using a thread, you can tell me!

About VC Operations Excel cannot quit a process issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.