This is a discussion on Article : Active X importer -- AxImp.exe (.Net Framework Tools Series) within the VB.NET Programming forums, part of the Software Development category; Hi All, Aximp is a tool which is shipped with .Net Framework where Ax stands for Active X and imp ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi All, Aximp is a tool which is shipped with .Net Framework where Ax stands for Active X and imp for importer. This tool is used to convert Active X control to a windows form control. The .NET equivalent of ActiveX controls are Windows Forms controls. This tool actually creates a wrapper around the Active X control so that it can used from .NET (i.e. managed code). It basically creates an Active X interop assembly. This wrapper class is derived from System.Windows.Forms.AxHost. This wrapper control contains an instance of the underlying ActiveX control and has access to all its properties and events. To host any Active X control on a Win Form it is necessary to extend it from Axhost class. There are several ways by which you can use Active X components in the .NET. One of the ways would be adding the active component to your toolbox directly as follows :- 1. Right click on the tool box . 2. Select customize tool box. 3. Select the COM component. 4. Drag and drop the Active X control on your form. You will see that .NET Studio has generated an interop assembly (solution explorer) for the selected active X control. Now you can use this control seamlessly as you would have used any other .NET component. We will create this same interop using Aximp.exe. Go to the visual studio command prompt and type aximp.exe /h. This will display all the options available with Active X importer. To create a interop for an active component you need to type the name of the component ( make sure you in the same directory as your Active X component is ... else type the whole path). e.g. C:\WINNT\system32>aximp comdlg32.ocx (This is VB's common dialog Active X control) This will generate interop assemblies for the selected active X control as shown below. Generated Assembly: C:\WINNT\system32\MSComDlg.dll Generated Assembly: C:\WINNT\system32\AxMSComDlg.dll You will notice that there are 2 assemblies that are generated, but one prefixed with Ax. The second one that is the one which is prefixed with Ax is the Active X Assembly and the first one is the Interop assembly. The Interop assembly made by tlbimp is same as the one made by aximp. Open the AxMSComDlg.dll with ildasm and notice that it extends System.Windows.Forms.Axhost class which is required to host an Active X control in a winform. |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Difference between passive FTP and active FTP? | srikumar_l | Networking & Internet Connectivity | 0 | 12-20-2007 02:08 AM |
| Is it possible to read contacts from a series 60 3rd edition phone using J2ME? | it.wily | J2ME | 3 | 11-26-2007 06:43 AM |
| Active Directory Requirement | nnraja | Server Management | 1 | 10-17-2007 04:06 AM |
| Article Section? | Karpagarajan | Discussweb HQ | 2 | 04-05-2007 02:57 AM |
| Is someone using your assembly? (SecUtil.exe .Net FrameWork Tools Series) | Gopisoft | VB.NET Programming | 0 | 02-25-2007 09:31 PM |