Develop OCX controls under WinCE

Source: Internet
Author: User
The biggest difference between ActiveX Control and window (2 k, XP) in Windows is to compile OCX of two versions and install one on Windows, in this way, you can use the OCX for programming in the EVC environment, and install it on WinCE to use the ocx program for calling.

A simple OCX test is made here, which can be successful under evc4.2/simulator wince4.2. The procedure is as follows:

1. Develop the OCX control for CE edition. First, develop your own OCX control in EVC. After compilation, OCX will be automatically downloaded to the simulator.

2. register the control in the simulator. registration Method: use the remote filter viewer of EVC to load the directory c:/program files/Microsoft Embedded C ++ 4.0/EVC/wce400/target/x86/regsvrce.exe to the Windows directory of the simulator. Directly upload the regsvrce.exe file to the simulator. After Beibei is successful, run regsvrce.exe on the simulator to register the control. For example, Run "regsvrce ceactivexbtn. ocx" to register the ceactivexbtn control.

4. Develop the OCX control for Win32 edition. Create a project with the same name as the above project in VC (must be the same, otherwise it will not be successful), put the project (VC Project) copy the two project files DSW and DSP to the directory of the CE Control Project, put them in the same directory as vcw and VCP, and then open the VC project under this directory, it is found that "Win32 Unicode debug" is selected in the compilation configuration. compilation may produce a link error, that is, mfc42ud; Lib. Of course, this error will not occur if the VC installation is complete. But it doesn't matter. Change the configuration to "Win32 debug", so that the compilation is successful. After compilation is completed, VC automatically registers the OCX control of the Win32 version.

5. Add the OCX control of Win32 edition (not ce edition) to EVC. Method: Create a demo project. In the dialog box editor of the project, right-click "insert ActiveX controls" and choose "add controls, find and add the Win32 OCX Control compiled with VC.

OK! Now we can call the OCX programming on EVC.

When used on a board, register it.

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.