PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/HTMLEmbedActiveX/MFCActiveX.html

#
HTML | 54 lines | 51 code | 3 blank | 0 comment | 0 complexity | e587fb04c1a7f18d234c42ae0fbfc118 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>MFCActiveX</title>
  5. <script language="javascript" type="text/javascript">
  6. function SetFloatProperty() {
  7. var fVal = parseFloat(floatPropInput.value);
  8. if (!isNaN(fVal)) {
  9. MFCActiveX1.FloatProperty = fVal;
  10. }
  11. }
  12. function GetFloatProperty() {
  13. alert("MFCActiveX1.FloatProperty = " +
  14. MFCActiveX1.FloatProperty.toString());
  15. }
  16. </script>
  17. <script language="vbscript" type="text/vbscript" for="MFCActiveX1" event="FloatPropertyChanging(NewValue, byref Cancel)">
  18. ' http://support.microsoft.com/kb/253282
  19. ' we do not use jscript or javascript because they passes all variables
  20. ' by value (not by reference). The FloatPropertyChanging event requires
  21. ' passing the cancel param by reference.
  22. If confirm("FloatProperty is being changed to " & Cstr(NewValue)) Then
  23. Cancel = false
  24. Else
  25. Cancel = true
  26. End If
  27. ' 'Cancel' does not seem to work [to be fixed in future, Jialiang]
  28. </script>
  29. <style type="text/css">
  30. body
  31. {
  32. font-family: Calibri;
  33. }
  34. #MFCActiveX1
  35. {
  36. height: 96px;
  37. width: 291px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <object id="MFCActiveX1" classid="CLSID:E389AD6C-4FB6-47AF-B03A-A5A5C6B2B820">
  43. </object>
  44. <p>
  45. </p>
  46. FloatProperty:
  47. <input type="text" name="floatPropInput" value="" style="width: 120px" />
  48. <input type="button" name="submit" value="Set" onclick="SetFloatProperty()" />
  49. <input type="button" name="retrieve" value="Get" onclick="GetFloatProperty()" />
  50. </body>
  51. </html>