Use mapwingis. ocx in. net

Source: Internet
Author: User

The following uses the vs2008 development environment as an example:
----------------------------------------------------------------------
Step 1: Convert the COM interface to a. net interface

Before using mapwingis. ocx in the. NET language, you must convert the COM interface to the. NET interface,ProgramAccess the specific implementation functions in COM through the. NET interface.

Method (1) When mapwingis. ocx is added to the. NET project, a file named InterOP. mapwingis. dll (or InterOP. mapwingis.4.7.dll) is automatically generated. This dll is the. net interface component generated by vs2008 for the added OCX. The program uses this DLL to deal with OCX.

You can also use the tlbimp.exe tool of vs2008to manually obtain this file.

A. Open the vs2008 command line (Start Menu -- Microsoft Visual Studio 2008 -- Visual Studio Tools -- Visual Studio 2008 command prompt)

B.

Cd c: \ Dev \ mapwindow4dev \ bin

Tlbimp mapwingis. ocx/out: InterOP. mapwingis. dll/asmversion: 4.7.4.0

Step 2: Wrap the OCX control into a Windows Forms Control

For the OCX control, it is not enough to convert the COM interface to the. NET interface. You also need to use aximp to wrap the OCX control into Windows Forms control.

Aximp "mapwingis. ocx"/out: axinterop. mapwingis. dll/RCW: InterOP. mapwingis. dll

Before using this command, you must register OCX and generate InterOP. mapwingis. dll.

Step 3: reference in the projectINterop. mapwingis. dllAndAxinterop. mapwingis. dll

In this way, you can use mapwingis. ocx to develop applications. Of course, after the mapwindow GIS desktop version is installed, you can get it directly from the installation directory (mapwingis. ocx, InterOP. mapwingis. dll and axinterop. mapwingis. dll)

For more com and. Net interoperability tools, refer:Http://msdn.microsoft.com/zh-cn/library/dd233112.aspx

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.