How Do I Embed a Measurement Studio ActiveX Control in ASP.NET?
Primary Software: Measurement Studio>>.NET Support
Primary Software Version: 8.1
Primary Software Fixed Version: N/A
Secondary Software: N/A
Problem: I want to embed a Measurement Studio ActiveX control, specifically the CWGraph3D in an ASP.NET application. How do I go about doing this?
Solution: In order to use any Measurement Studio ActiveX control in an ASP.NET page, you must manually add it as an object in your ASP.NET code.
To do so, simply add the following line in the source HTML:
<object id="Object1" classid="CLSID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" codebase="OCX_Name.ocx"></object>
For example, the HTML code to display the CWGraph3D control would be:
<object id="CW3DGraph" classid="CLSID:2AFA9F10-0B6A-11D2-A250-00A024D8324D" codebase="cw3dgrph.ocx"></object>
Note: To get to the source HTML view in Visual Studio, right-click the .aspx file in the solution explorer and click View Markup.
Finding the classid:
The classid is the identifier for the ActiveX control. You can find the classid by searching the registry for the ActiveX control name. For instance, to find the classid for the CWGraph3D control:
- Open the Registry Editor by clicking Start»Run... and typing regedit in the Run dialog
- In the Registry Editor, select Edit»Find... to open the Find dialog
- Check the Data checkbox, uncheck the Match whole string only checkbox and search for the ActiveX control "CWGraph3D Control"
- The classid is the registry key that has the control name as its Data value

Finding the codebase:
The codebase tag specifies the location of the .ocx file in relation to the ASP.NET page so that the page can load it. Measurement Studio ActiveX controls automatically get registered with the computer so the path of the file is not necessary, only the filename of the .ocx file.
To find the codebase, expand the classid registry key from the previous step and the location of the .ocx file is specified as the value (data) for the InprocServer32 key.

Example Code:
The attached file ActiveX in ASP.NET.zip contains an example ASP.NET application that embeds a Measurement Studio 3DGraph ActiveX control in it.
Browser Compatibility:
As it is a Microsoft product, ActiveX is officially natively supported in Internet Explorer. Firefox, Opera and other browsers do not officially support ActiveX.
Related Links: Firefox Support: ActiveX
Attachments:
ActiveX in ASP.NET.zip
Report Date: 02/06/2008
Last Updated: 02/13/2008
Document ID: 4I5BH3PE