第一部分 c++
关键程序文件:
xxx.idl
1
[id(DISPID_ABOUTBOX)]
void
AboutBox();
2 [id( 4 )] short IReadPort(unsigned char * inPArr1);//byte类型接口, 在非托管语言中可以正常使用,托管语言中无法正常传入数组
3 [id( 3 )] short I1( void * a1);//与c#的传入System.InPtr类型对应。
2 [id( 4 )] short IReadPort(unsigned char * inPArr1);//byte类型接口, 在非托管语言中可以正常使用,托管语言中无法正常传入数组
3 [id( 3 )] short I1( void * a1);//与c#的传入System.InPtr类型对应。
xxxCtrl.h
//
调度和事件 ID
public :
enum {
};
short IReadPort(unsigned char inPArr1[]);//程序内接口定义
short I1( void * a2);//
};
public :
enum {
};
short IReadPort(unsigned char inPArr1[]);//程序内接口定义
short I1( void * a2);//
};
xxxCtrl.cpp
![C++定义DLL,C调用 数组传递 - JAN - mingrui-521 的博客](https://i-blog.csdnimg.cn/blog_migrate/cdec0645add3fc3c328197dda5c76203.gif)
![C++定义DLL,C调用 数组传递 - JAN - mingrui-521 的博客 C++定义DLL,C调用 数组传递 - JAN - mingrui-521 的博客](https://i-blog.csdnimg.cn/blog_migrate/81178cc93a2a3bb5048d90d76e7ec935.gif)
//
调度映射
BEGIN_DISPATCH_MAP(CSCMUSBBULKCtrl, COleControl)
DISP_FUNCTION_ID(CSCMUSBBULKCtrl, " AboutBox " , DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)
D
BEGIN_DISPATCH_MAP(CSCMUSBBULKCtrl, COleControl)
DISP_FUNCTION_ID(CSCMUSBBULKCtrl, " AboutBox " , DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)
D