ActiveXImport

DanielGrunwald edited this page Aug 27, 2007 · 1 revision
  1. Open a console window and change the directory(folder) to the location you want to place the C# COM interface. At the command prompt type: aximp.exe c:<your activex path>\Activex_Filename.ocx. The import process will create two files, Activex_Filename.dll and AxActivex_Filename.dll. Remember that some ActiveX files can also have a .dll extension; for example, shdocvw.dll is the Internet Explorer ActiveX.

aximp.exe is included in the .NET Framework SDK, usually installed in C:\Program Files\Microsoft.NET\SDK\v2.0\bin.

  1. Start #develop and open a project. Activate the form design window. Right click on one of the tabs in the Tools pad. From the drop down list choose Configure Sidebar. The Configure Sidebar window will open.

  2. The left-hand pane displays a list of the available categories. By default three categories are listed: Windows Forms, Data, and Components. You can add the activeX component to one of these tabs or create a new one. To add to an existing category click on the name and skip to Step 4. To add a new tab, click the new button in the lower left corner. The New Category dialog box will open. Type the text you want displayed on the new Tools tab. Click on your new category name in the list.

  3. Click the Add Components button. The Add Components dialog box will be displayed. Click the Custom tab. Click the browser button to the right of the File Name textbox. The Open dialog box will appear. Use the Open explorer window and browse, locate, and select the AxActivex_Filename.dll file you created in Step 1.

  4. The file path and name should now be displayed in the File Name textbox. Click the Show Components button. The components should now be displayed in the right-hand pane. Click the OK button.

  5. The activeX components should now be available on the category tab you selected. Before you can place an instance of the control on your form, you must first change the form's Font.Unit property to Point in the Property pad.

  6. You can now place an instance of the control on your form and have access to the properties and events in the Property pad.