新手求助,关于函数返回值问题

dongni11 2010-06-18 01:27:01
dll 函数:

EXPORT client* lib_create( uint number, char* pass )//

{

client* q;
if( !if_init )
lib_init();
NEW( q, sizeof(client) );
if( !q ){
DEL( q );
return NULL;
}
client_create( q, number, pass );
q->auto_accept = 1; //temporarily do this
return q;
}

EXPORT int lib_login( client* q )//2222222222
{
int ret;
pthread_t ptr;
ret = pthread_create( &ptr, NULL, login_ex, (void*)q );
if( ret != 0 ){
DBG("thread creation failed. ret=%d", ret );
}
return ret;
}


调用函数 :

HMODULE hInst;
hInst = LoadLibrary("lib.dll");
typedef void (CALLBACK* CallDll)(uint a, char* b);
CallDll fun= (CallDll)GetProcAddress(hInst,"lib_create");
q=fun( uid, password);
typedef void (CALLBACK* CallDl)(client* q);

CallDl fun1= (CallDll)GetProcAddress(hInst,"lib_login");
fun1( q );
FreeLibrary(hInst);


出现错误 :393 F:\MY~1\8811\my.c void value not ignored as it ought to be
396 F:\MY~1\8811\my.c [Warning] initialization from incompatible pointer type

是怎么回事啊?
...全文
98 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
chjh0540237 2010-06-18
  • 打赏
  • 举报
回复
,please don't mind warning
honemay 2010-06-18
  • 打赏
  • 举报
回复
这是打印的警告不是错误!程序可以运行!

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧