PageRenderTime 25ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/HTMLEmbedActiveX/MFCSafeActiveX.html

#
HTML | 61 lines | 54 code | 3 blank | 4 comment | 0 complexity | 734489bb08014df94fd037dbefa82870 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>MFCSafeActiveX</title>
 5
 6    <script language="javascript" type="text/javascript">
 7        function SetFloatProperty() {
 8            var fVal = parseFloat(floatPropInput.value);
 9            if (!isNaN(fVal)) {
10                MFCSafeActiveX1.FloatProperty = fVal;
11            }
12        }
13        function GetFloatProperty() {
14            alert("MyActiveX1.FloatProperty = " +
15                MFCSafeActiveX1.FloatProperty.toString());
16        }
17        function HelloWorld() {
18            alert("HelloWorld");
19        }
20    </script>
21
22    <script language="vbscript" type="text/vbscript" for="MFCSafeActiveX1" event="FloatPropertyChanging(NewValue, byref Cancel)">
23'       http://support.microsoft.com/kb/253282
24'       we do not use jscript or javascript because they passes all variables
25'       by value (not by reference). The FloatPropertyChanging event requires 
26'       passing the cancel param by reference.
27        If confirm("FloatProperty is being changed to " & Cstr(NewValue)) Then
28            Cancel = false
29        Else
30            Cancel = true
31        End If
32'       'Cancel' does not seem to work [to be fixed in future, Jialiang]        
33    </script>
34
35    <!--<script language="javascript" type="text/javascript" 
36        for="MFCSafeActiveX1" event="FloatPropertyChanging(NewValue, Cancel)">        
37        alert("FloatProperty is being changed to " + NewValue.toString());
38    </script>-->
39    <style type="text/css">
40        body
41        {
42            font-family: Calibri;
43        }
44        #MFCSafeActiveX1
45        {
46            height: 120px;
47            width: 291px;
48        }
49    </style>
50</head>
51<body>
52    <object id="MFCSafeActiveX1" classid="CLSID:1EBAE592-7515-43C2-A6F1-CDEEDF3FD82B">
53    </object>
54    <p>
55    </p>
56    FloatProperty:
57    <input type="text" name="floatPropInput" value="" style="width: 120px" />
58    <input type="button" name="submit" value="Set" onclick="SetFloatProperty()" />
59    <input type="button" name="retrieve" value="Get" onclick="GetFloatProperty()" />
60</body>
61</html>