网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

调用动态库!

#include

企业建站必须是能够以充分展现企业形象为主要目的,是企业文化与产品对外扩展宣传的重要窗口,一个合格的网站不仅仅能为公司带来巨大的互联网上的收集和信息发布平台,创新互联建站面向各种领域:成都户外休闲椅成都网站设计营销型网站解决方案、网站设计等建站排名服务。


#include

//客户端初始化 获取handle上下

typedef int(*CltSocketInit)(void **handle);

//客户端发报文

typedef int(*CltSocketSend)(void *handle, unsigned char *buf, int buflen);

//客户端收报文

typedef int(*CltSocketRev)(void *handle, unsigned char *buf, int *buflen);

//客户端释放资源

typedef int(*CltSocketDestory)(void *handle);//以上都是指针函数

int main(){

HINSTANCE hinstance = NULL;

hinstance = ::LoadLibrary("D:\\SocketClient.dll");//获得句柄

CltSocketInit cltSocketInit = (CltSocketInit)GetProcAddress(hinstance, "cltSocketInit");//获取函数地址传给函数指针!

CltSocketSend cltSocketSend = (CltSocketSend)GetProcAddress(hinstance, "cltSocketSend");

CltSocketRev cltSocketRev = (CltSocketRev)::GetProcAddress(hinstance, "cltSocketRev");

CltSocketDestory cltSocketDestory = (CltSocketDestory)::GetProcAddress(hinstance, "cltSocketDestory");

void *handle = NULL;

unsigned char buf[100];

int buflen = 10;

memcpy(buf, "ddddddddddssssssssss", 10);

unsigned char out[100] = { 0 };

int outlen = 0;

int ret = cltSocketInit(&handle);

ret = cltSocketSend(handle, buf, buflen);

ret = cltSocketRev(handle, out, &outlen);

ret = cltSocketDestory(handle);

printf("out:%s", out);

system("pause");

}


网站标题:调用动态库!
网页链接:http://bjjierui.cn/article/jggsgi.html

其他资讯