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

How to use environment variables in nginx configuration file

Preface Nginx is an HTTP server designed for perf...

WeChat applet scroll-view realizes left and right linkage

This article shares the specific code for WeChat ...

Detailed explanation of MySQL partition table

Preface: Partitioning is a table design pattern. ...

JavaScript design pattern chain of responsibility pattern

Table of contents Overview Code Implementation Pa...

js uses FileReader to read local files or blobs

Table of contents FileReader reads local files or...

MySQL database must know sql statements (enhanced version)

This is an enhanced version. The questions and SQ...

How to write CSS elegantly with react

Table of contents 1. Inline styles 2. Use import ...

How to configure ssh/sftp and set permissions under Linux operating system

Compared with FTP, SSH-based sftp service has bet...

Detailed explanation of MySQL combined query

Using UNION Most SQL queries consist of a single ...

Linux configuration SSH password-free login "ssh-keygen" basic usage

Table of contents 1 What is SSH 2 Configure SSH p...

How to configure eureka in docker

eureka: 1. Build a JDK image Start the eureka con...

JS implements random generation of verification code

This article example shares the specific code of ...

How to set the text in the select drop-down menu to scroll left and right

I want to use the marquee tag to set the font scro...

Steps to split and compress CSS with webpack and import it with link

Let's take a look at the code file structure ...