|
|
|
ActiveX TUTORIALS
Basic ActiveX TUTORIAL
Create a basic MFC ActiveX Project and select the runtime license and help files options.
Select Available in "Insert Object" dialog option.
Go to the "Build" menu and select "Batch Build..." and create the project.
Go to the Class Wizard and add the double click to active the object.
Add the code for the double click action. A simple "Hello" message box will appear when you double-click on the control.
In the next step we have to get the operating system to accept the control by registering it using "regsvr32.exe".
First, we copy the Release build of the BasicActiveXControl.ocx file to the System32 folder.
Next, we run "regsvr32 BasicActiveXControl.ocx" in the Run dialog box. To run "Run" click on "Start" and it is located just above the "Shut Down" button.
Now we run the registration program:
Now the control should be registered successfully with the operating system:
Now it is time to test the control with an HTML page.
This is a simple html file using the clsid of the control class. The clsid is the reference to the class that the operating system will use when the control is activated.
This is the html page after the control has been left-double-clicked. A very simple ActiveX control.
|