New Message on dotNET User Group Hyd

Article : Active X importer -- AxImp.exe (.Net Framework Tools Series)

Reply
  Reply to Sender   Recommend Message 1 in Discussion
From: Nasha

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.
 
Yesterday I had posted an article on Wincv.exe did anyone try out the code snippet.If yes than please let me know.

-- Please post your queries and comments for my articles in the usergroup for the benefit of all. I hope this step from my end is helpful to all of us.

Regards,

Namratha (Nasha)

 


View other groups in this category.

baazee.com

Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to