DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> WEB網站前端 >> 前端技巧 >> 網頁中通過param name方式給ActiveX控件的屬性賦值示例
網頁中通過param name方式給ActiveX控件的屬性賦值示例
編輯:前端技巧     

復制代碼代碼如下:
<HTML>
<HEAD>
<TITLE>Test ActiveX</TITLE>
<OBJECT ID="TestCtrl" NAME="<span style="font-family:Arial,Helvetica,sans-serif">TestCtrl</span><span style="font-family:Arial,Helvetica,sans-serif">"</span>
CODEBASE="calc.CAB#version=1,0,0,1"
CLASSID="clsid:CDF1D789-F8A3-48F2-B0DE-0D72F2D89F76">
<PARAM NAME="downpath" VALUE="123456" />
</OBJECT>
<script language="javascript">
function doTest()
{
alert(<span style="font-family:Arial,Helvetica,sans-serif">TestCtrl</span><span style="font-family:Arial,Helvetica,sans-serif">.</span><span style="font-family:Arial,Helvetica,sans-serif">downpath</span><span style="font-family:Arial,Helvetica,sans-serif">);</span>
}
</script>
</HEAD>
<BODY>
<input type="button" value="Get left time" id="btnOK" onclick="doTest();"></input>
</BODY>
</HTML>

如果創建的屬性類型是BSTR,變量名是downpath,要添加如下代碼:

創建屬性時選擇member variable方式,然後在下面代碼中添加如下代碼

復制代碼代碼如下:
void COCXTestCtrl::DoPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
// TODO: Call PX_ functions for each persistent custom property.
PX_String(pPX, _T("downpath"), m_downpath, _T(""));
}
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved