Example of assigning values ​​to ActiveX control properties by param name in a web page

Example of assigning values ​​to ActiveX control properties by param name in a web page

Copy code
The code is as follows:

<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>

If the created attribute type is BSTR and the variable name is downpath, add the following code:

When creating an attribute, select the member variable method, and then add the following code in the code below

Copy code
The code is as follows:

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(""));
}

<<:  How to implement multiple parameters in el-dropdown in ElementUI

>>:  CSS isolation issue in Blazor

Recommend

Vue+element implements drop-down menu with local search function example

need: The backend returns an array object, which ...

Summary of commonly used multi-table modification statements in Mysql and Oracle

I saw this question in the SQL training question ...

mysql security management details

Table of contents 1. Introduce according to the o...

Detailed explanation of the solution for migrating antd+react projects to vite

Antd+react+webpack is often the standard combinat...

How to manually deploy war packages through tomcat9 on windows and linux

The results are different in Windows and Linux en...

mysql 8.0.19 winx64.zip installation tutorial

This article records the installation tutorial of...

Example of using MySQL to count the number of different values ​​in a column

Preface The requirement implemented in this artic...

How to add Tomcat Server configuration to Eclipse

1. Window -> preferences to open the eclipse p...

Sharing several methods to disable page caching

Today, when developing, I encountered a method wh...

Detailed explanation of html-webpack-plugin usage

Recently, I used html-webapck-plugin plug-in for ...