下面这几句是什么意思??我怎么看不太明白!VC++高手进!

来源:百度知道 编辑:UC知道 时间:2024/06/17 04:26:54
//通信函数
extern "C" __declspec(dllexport) int Init_iFLYComm(char *ip, int r_port, int t_port, unsigned int ptr);
extern "C" __declspec(dllexport) int Send_iFLYComm(unsigned char iFLY_Dest, unsigned char iFLY_Sour, unsigned char *tbuf, int len);
extern "C" __declspec(dllexport) int Recv_iFLYComm(unsigned char *iFLY_Dest, unsigned char *iFLY_Sour, unsigned char *rbuf, int *len);

C 程序, 自己写的动态链接库程序里类似头文件的部分。

extern "C" __declspec(dllexport) int Init_iFLYComm(char *ip, int r_port, int t_port, unsigned int ptr);

extern "C" __declspec(dllexport) -- C 语言外部函数,声明为从 动态链接库 输出(英文export --输出,进出口的出口的意思)函数。程序运行时从DLL调来可执行码。

int -- 函数送返 整型量
Init_iFLYComm -- 函数名 (Init:初始化,Comm:通讯)

(char *ip, int r_port, int t_port, unsigned int ptr) -- 形式参数,与普通函数形参写法一样,不用解释了。port--口。r_port--接收口,t_port -- 发送口

------------------------
Send_iFLYComm -- 发送函数

Recv_iFLYComm -- 接收函数

_Dest -- 目的地。。。

不论是否用c编译器,还是c++编译器,都按c的语法进行编译

写动态库用的 就是dll文件

这么声明的函数,其他程序调用这个库文件的时候可以使用