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.