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

Detailed explanation of Vuex overall case

Table of contents 1. Introduction 2. Advantages 3...

CSS and CSS3 flexible box model to achieve element width (height) adaptation

1. CSS realizes fixed width on the left and adapt...

MySQL count detailed explanation and function example code

Detailed explanation of mysql count The count fun...

Summary of commonly used SQL in MySQL operation tables

1. View the types of fields in the table describe...

Examples of two ways to implement a horizontal scroll bar

Preface: During the project development, we encou...

Docker - Summary of 3 ways to modify container mount directories

Method 1: Modify the configuration file (need to ...

Quick understanding of Vue routing navigation guard

Table of contents 1. Global Guard 1. Global front...

Bug of Chinese input garbled characters in flex program Firefox

Chinese characters cannot be input in lower versio...

Display flex arrangement in CSS (layout tool)

Regarding display: flex layout, some people have ...

HTML discount price calculation implementation principle and script code

Copy code The code is as follows: <!DOCTYPE HT...

MySQL Series 7 MySQL Storage Engine

1. MyISAM storage engine shortcoming: No support ...

Summary of Vue's cross-domain problem handling and solutions

When you send a network request, the following sa...