VC ++ OCX control registration
Method 1: Run regsvr32 ocxname. ocx in DOS or Windows Command LineExample:Regsvr32 netshare. ocx // register the netshare. ocx control.Regsvr32/u netshare. ocx // unregister the netshare. ocx
JS Event Response example for implementing the OCX control
JS supports events of the OCX control. When an event defined by the OCX control occurs, JS can capture the event and process the event accordingly.
In my personal understanding, it is actually who will complete the event response. The OCX control itself can cer
I. Introduction to the Application of ActiveX:ActiveX controls, which are commonly called OCX controls, are part of ActiveX technology. ActiveX is a Component Object model COM-based technology introduced by Microsoft, including a series of extensions and enhancements to the Windows 32-bit Application programming interface (Win32 API) and Component Object model, with the goal of integrating the computer desktop environment with the Internet environment
Step 1:
Anyone who has used ActiveX knows that ActiveX cannot be recognized and used by the system if it is not registered. Generally, the installer automatically registers the ActiveX control it uses, but what if you need to manually register a widget? If you modify the registration table, it will be too annoying. There is a regsvr32.exe program under the systemfile folder of windows, which is the built-in ActiveX registration and anti-registration tool for Windows. Its usage is:Regsver32
Regsv
Step 1:
Anyone who has used ActiveX knows that ActiveX cannot be recognized and used by the system if it is not registered. Generally, the installer automatically registers the ActiveX control it uses, but what if you need to manually register a widget? If you modify the registration table, it will be too annoying. There is a regsvr32.exe program under the systemfile folder of windows, which is the built-in ActiveX registration and anti-registration tool for Windows. Its usage is:Regsver32
Regsv
In the process of writing a program, we often have some good controls, want to use their own programs, then first know how to register OCX control, the following formula control as an example to explain:
Registering the Formula one component on the target machine
To implement registration in programming, the code is as follows:
1 define functions in the local external function:
Function long DllRegisterServer () Library "Vcf15.
ActiveX and OLE are com-based applications whose file suffixes generally end with DLL and OCX. ocx, as a special DLL file, has a certain user interface and Event Response, the DLL file is only a collection of methods and properties.
1. Introduction to DLL
DLL, dynamic link library, or dynamic link library is a set of modules that contain functions and data and can be used by other applications.ProgramSh
its registration function (DllRegisterServer, DllUnregisterServer) directly in the memory address.The programming method is:1. Use Windows API function LoadLibrary to load ActiveX controls;2. Use the GetProcAddress function to get the registration function DllRegisterServer (logoff function is DllUnregisterServer) pointer in the ActiveX control;3. Use the CallWindowProc function to execute an ActiveX control registration function (DllRegisterServer, DllUnregisterServer) loaded into memory.Examp
addition to downloadingOCXfile, download the appropriateMFC DLLs, download a large quantity, then the relevant files can be packaged in the server to the client self-extracting installationCABfile. After the modifiedHTMLThe code snippet is as follows:align= "CENTER" classid= "CLSID:7bca18c6-2178-11d2-87c1- 00A024D948FB "Width= "height=" id= "marquee"Codebase= "http://218.168.188.188/scadaweb/Wclnt.cab#version=1,0,0,1 "> EMBED align= "CENTER" classid= "Clsid:7bca18c6- 2178-11d2- 87c1-00a024d
The biggest difference between ActiveX Control and window (2 k, XP) in Windows is to compile OCX of two versions and install one on Windows, in this way, you can use the OCX for programming in the EVC environment, and install it on WinCE to use the ocx program for calling.
A simple OCX test is made here, which can be
OCX packaging cab and signing process1. Package the cab
When creating a cab file, you must include all the relevant files. You can use depends (included in VC) to check the required files. Use the INF file to write these items.1. Create an INF file
Default. inf
Generally, it is in the [version] area at the beginning:
Eg: [version]
Signature = "$ Chicago $"
Advancedinf = 2.0
Next is the most important [Add. Code] area:
Eg: [Add. Code]
Getcertocx.
The following uses the vs2008 development environment as an example:----------------------------------------------------------------------Step 1: Convert the COM interface to a. net interface
Before using mapwingis. ocx in the. NET language, you must convert the COM interface to the. NET interface,ProgramAccess the specific implementation functions in COM through the. NET interface.
Method (1) When mapwingis.
extension. ocx,. CPL, And. DRV are also DLL, although the file extension has changed.You can create a DLL for the following purposes:(1) divide programs into separate modules that can be loaded as needed.(2) store resources specific to languages or regions.(3) Enable your own applications to use the core code library.(4) generate a COM object or ActiveX Control (OCX) in the process ).(5) use the OLE object
First, download the missing file
1, according to the above tips. A comdlg32.ocx file is missing.
2, we first want to download the "Comdlg32.ocx" file online. We can search directly on Baidu to download on it.
3, according to the prompts need to download the "Comdlg32.ocx" file first. We just need to download it.
Second, the installation of documen
that way.Then the Web pagewidth=400height=200Align=centerClsid:134dc7aa-a178-4432-bf32-615c27d5cd35 the same as the top. Test.cab is the bag just above. Don't write anedit.ocx here.Otherwise, it doesn't make sense to sign anything.If this is the only way to send online, because the certificate is invalid, generally considered invalid signature. You will be prompted for invalid signatures and cannot even be installed ...Import the certificate test.cer; OK, so you can use a valid signature for di
In fact, the use is not very large, because such OCX to run, must have digital signature, but also need to agree to install, or you will be prompted every time, what is not safe and so on.
Create an ActiveX control in VB and select the ActiveX Control Interface Wizard in the Add-in menu (if not, add one to the Add-in manager)
You can define the method you want here, the property, the event, and if you want to invoke the client Script, map to the membe
Register ocxname. ocxExample:Regsvr32 netshare. ocx // register the netshare. ocx control.Regsvr32/u netshare. ocx // unregister the netshare. ocx controlIf the netshare. ocx file is not in the system directory, you must add the complete path before the file name. In additio
Version] Signature = "$ Chicago $" advancedinf = 2.0 [add. code] test. OCX = test. OCX [getfilefromserver. OCX] file-win32-x86 = thiscabclsid = {5fb89c00-d175-45a7-9efc-15915dd5ad87} registerserver = yesdestdir = 11 fileversion = 1.0.0.1001
According to the instructions, destdir = 11. Dll will be installed under system32
But the actual situation is always install
Using regsvr32/u/s/n/I dllname. dllname indicates the ActiveX control file name, we recommend that you copy the following parameters to the system folder before installation:
/U-anti-registration control
/S-no matter whether the registration is successful or not, the prompt box is not displayed
/C-console output
/I-Skip the control option for installation (different from registration)
/N-do not register the control. This option must be
/I option used together
For example, if you want to registe
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.