You can import an .OCX into your ASP.NET project, and use it as a component,
by first wrapping it in a .NET interop assembly. However, if you have a
visual .OCX (a control you can use on a VB form), you cannot use it visually
in an ASP.NET page.
To use an .OCX component in your project, use the following steps:
1) Install the .NET Framework SDK, if you haven't already.
2) Open a Windows command prompt, and go into the directory where the OCX is
stored.
3) Run the following command line:
"c:\program files\microsoft.net\sdk\v1.1\bin\tlbimp.exe" ocxname.ocx
where ocxname.ocx is the name of the OCX. Note: If your SDK was installed
somewhere other than above, you'll need to change the path to the tlbimp.exe.
4) The tlbimp tool will inspect the OCX, and create an interop assembly for
it. Note the file it creates. This name is generated from the name of the
OCX's type library, and can be customized using a command line option for
tlbimp.
5) Go back into Web Matrix, and import the interop assembly into your project.
6) ASP.NET pages need to be in ASPCompat mode to use most OCXs, because
these components are not free threaded. Go into your page, and add an
attribute to the <%@ Page > directive at the top, like this:
<%@ Page AspCompat="true" %>
That's it - you should now be able to use this OCX on your page. You can't
drag and drop it onto the page, because it's not a web control, but you can
programmatically create one of these objects in your page code, such as in
Page_Load.
Thanks,
Shanku
> Hi,
>
[quoted text clipped - 9 lines]
>
> Thank you for any help.