Simple example of developing and deploying ATL (reposted) www.vckbase.com

xiaoxiao2021-03-06  127

With a simple example of the development and deployment of ATL ActiveX controls: Zeng Qiang download the source code to write an ATL component, plus a simple class, join in the class header file: BEGIN_CATEGORY_MAP (CAirlineInfo)

Implement_category (catid_safeforscripting)

Implement_category (catid_safeforinitializing)

End_category_map () then introduces the header file (#include ) required for the above code to stdafx.h. Another way to add a method to call the Winexec () function is OK, look at the ZQCOM project. Publish online needs to package dependencies to .cab, including components's DLL, DLL-dependent libraries and an INF file. The content of the INF file in my example is as follows: [Version]

Signature = "$ chicago $"

Advancedinf = 2.0

[Add.code]

ZQcom.dll = zqcom.dll

MSVCR71D.DLL = MSVCR71D.DLL

[zqcom.dll]

FILE-WIN32-X86 = thiscab

CLSID = {CB4C551D-2BF5-40F7-866B-922DBEA618F2}

Fileversion = 1, 0, 0, 0

RegisterServer = YES

[msvcr71d.dll]

FILE-WIN32-X86 = thiscab

RegisterServer = yes, [version] content is fixed; [add.code] is the content you want to add, zqcom.dll is the component to be added, the msvcr71d.dll is the dependency library of ZQcom.dll, (I use .NET, It is therefore MSVCR71D.DLL, and if the component written by VC6.0 is MFC42.DLL); [zqcom.dll] is some information, and the CLSID corresponds to the class's CLSID. Note: Since the component is not signed, the client is accessible to reduce security settings, and the Internet and intranet settings are changed to allow running unqualified ActiveX components to be OK, and then it will come back after installation. Method: Cabarc Ne: /myinf.cab E: /ZQcom.dll E: /TEST.INF in the command line: Cabarc Ne: /myinf.cab e: /zqcom.dll E: /TEST.INF Put the generated .cab in the corresponding location, my CAB Put: C: / INETPUB / WWWROOT / Under. If the Cabarc is not running, then search it on the machine, then join the environment path, everything is OK.

转载请注明原文地址:https://www.9cbs.com/read-127010.html

New Post(0)