I helped my colleagues write several lines of code and registered/uninstalled the OCX control in the installation/download program.

Source: Internet
Author: User

 

I wrote a small console program, which is used to register/uninstall the OCX control and used in the installation and uninstallation program of Inno Setup.

 

# Include "stdafx. H "# include <windows. h ># include <iostream> Using STD: cout; Using STD: Endl; Using STD: cerr; int _ tmain (INT argc, _ tchar * argv []) {_ Try {startupinfo Si1 = {sizeof (Si1)}; process_information PI1; startupinfo I2 = {sizeof (I2)}; process_information Pi2; wchar wcmdline1 [] = l "regsvr32.exe playview_ocx.ocx"; wchar wcmdline2 [] = l "regsvr32.exe playback_ocx.ocx"; cout <Endl <"is preparing to register pl Ayview_ocx.ocx "<Endl; bool bret1 = createprocessw (null, wcmdline1, null, null, false, 0, null, null, & Si1, & PI1 ); if (false = bret1) {cerr <Endl <"failed to create registration process 1. Run as administrator! "<Endl; System (" pause "); Return-1;} // wait for process 1 to finish waitforsingleobject (pi1.hprocess, infinite ); cout <Endl <"Preparing to register playback_ocx.ocx" <Endl; bool bret2 = createprocessw (null, wcmdline2, null, null, false, 0, null, null, & I2, & Pi2); If (false = bret2) {cerr <Endl <"failed to create the registration process 2. Run it as administrator! "<Endl; System (" pause "); Return-1 ;}cout <Endl; closehandle (pi1.hthread); closehandle (pi1.hprocess); closehandle (pi2.hthread ); closehandle (pi2.hprocess); System ("pause"); Return 0; }__ handle T (exception_execute_handler) {cerr <Endl <"exception" <Endl; return-2 ;}}

 

 

 

 

 

I helped my colleagues write several lines of code and registered/uninstalled the OCX control in the installation/download program.

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.