VS2008 add OCX external method to the Web call
The first is the OCX plugin Add method
Here in _danedit, not underneath it. Right-click to add a method, here added
CHAR Caneditctrl::sayhello (void)
{
Afx_manage_state (AfxGetStaticModuleState ());
TODO: Add the Dispatch handler code here
MessageBox (L "Hello");
return 0;
}
Modify a Web page file
<script language= "JavaScript" >
function Dotest ()
{
Test. SayHello ();
}
</script>
<input type= "button" value= "test Addition" id= "Btnok" onclick= "dotest ();" ></input>
<table width= "border=" 1 ">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<tr>
<object classid= "clsid:134dc7aa-a178-4432-bf32-615c27d5cd35" id= "test" codebase= "http://192.168.0.222/AnEdit/ test.cab#version=1,0,0,1 "
Width= "433" height= "hspace=" 0 "vspace=" 0 "align=" top "title=" Top "
</object>
<tr>
Recompile, re-package the registration.
Client Access host address, successful
Web page Call OCX method