当前位置:网站首页>Getting started with COM programming 1- creating projects and writing interfaces
Getting started with COM programming 1- creating projects and writing interfaces
2022-07-24 19:35:00 【Yulong_】
The following projects were built and developed using vs2010, And vs2015、2017 Not much difference
1、 establish ATL Project and name it test1

2、 Application type selection Dynamic link library

3、 Right click item properties Add the class And select ATL Simple objects , Name it Func



4、 Select a custom interface

5、 Press Ctrl+Shift+C Switch to Class view , Right click IFunc Class and add methods , Let's write one Interface for integer summation Add

The interface has three parameters in total ,[in LONG n1,in LONG n2,out retval LONG* pRet]
among pRet Is the return value , Yes, it will n1 and n2 The result of summation , With LONG A pointer to is passed into the function as an argument

6、 After creating the interface , Click... In class view mode CFunc class , Click again Add Interface , Jump to the implementation of the interface , Modify the interface implementation

7、 Realization Cat Interface ( String splicing interface , Reference resources Add Interface creation )
There are three parameters [in BSTR str1,in BSTR str2,out retval BSTR* pRet]
And Add As the interface , The third parameter is the result of the splicing of the first two parameters


8、 Compile and pass ( If not compiled , It may be registration COM Failure , You need an administrator to run visual studio Compile later ), Next we will talk about How to call your own COM Interface

边栏推荐
- Thread theory knowledge
- [untitled]
- Interceptors and filters
- MySQL final chapter
- Converter
- How to encrypt your own program with dongle
- Leetcode402 remove K digits
- Day 4 (item 1: household income and expenditure records)
- Reading notes: you only look once:unified, real time object detection
- Unity code imports packages through package manager
猜你喜欢

Description of large and small end mode

Interface component devaxpress asp Net v22.1 - new office 365 dark theme

Pay close attention! List of the latest agenda of 2022 open atom open source Summit

Meshlab&PCL ISS关键点
Cmake series tutorial 2 HelloWorld

文献阅读:GoPose 3D Human Pose Estimation Using WiFi
![Detailed explanation of DHCP distribution address of routing / layer 3 switch [Huawei ENSP]](/img/77/28e8f826c7ee93fedada405c70b82b.png)
Detailed explanation of DHCP distribution address of routing / layer 3 switch [Huawei ENSP]
![[JVM learning 03] class loading and bytecode Technology](/img/b4/9482b02b58580171235fd4c36129e9.png)
[JVM learning 03] class loading and bytecode Technology

Create a life cycle aware MVP architecture

How to encrypt your own program with dongle
随机推荐
纯C实现----------尼科彻斯定理
[understanding of opportunity-48]: Guiguzi - Chapter 7 - collect information in advance, make predictions and implementation plans in advance
Mysql8.0 learning record 20 - trigger
信道状态信息(CSI)共轭相乘去噪法
[Huawei lyevk-3861a intelligent IOT development board evaluation] unpacking experience and Hisilicon hi3861v100 chip learning experience
MySQL final chapter
day 1
Sword finger offer 42. maximum sum of continuous subarrays
02 | 环境准备:如何在windows下安装和配置一个基本的php开发环境?
Leetcode402 remove K digits
[face to face experience of school recruitment] 8 real questions of pointer interview. Come and test how many you have mastered.
Oneinstack installation and configuration PHP 8.1 and MySQL 8.0-oneinstack site building novice tutorial
Decorator of function
Solve the problem of disconnection due to long idle time after SSH login
Integer
How to encrypt your own program with dongle
Timed task framework
Day 9 (this keyword and experiment)
Software core data protection solution
Detailed explanation of ELF format (I)