我先定义了一些函数指针,但是莫名其妙的发生了些问题,请各位大大帮帮忙.
有60多个函数已经成功了,还有40多个函数有问题。
那些函数我是参考http://windowssdk.msdn.microsoft.com/en-us/library/ms741394.aspx 这里的。
好不容易攒到20分,各位大大不要嫌少呀。我带的头文件是
#include "stdio.h"
#include "Windows.h"问题一:
void (__stdcall *freeaddrinfo1)(struct addrinfo *);
发生的错误:
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information问题二:
int (__stdcall * getaddrinfo1)(const char FAR* ,const char FAR* ,const struct addrinfo FAR* ,struct addrinfo FAR** ); proc=GetProcAddress(hModule,"getaddrinfo");
getaddrinfo1= (int (__stdcall *)(const char FAR* ,const char FAR* ,const struct addrinfo FAR* ,struct addrinfo FAR** ))proc;
发生的错误:
error C2440: '=' : cannot convert from 'int (__stdcall *)(const char *,const char *,struct DllMain::addrinfo,const struct DllMain::addrinfo *,struct DllMain::addrinfo,struct DllMain::addrinfo ** )' to 'int (__s
tdcall *)(const char *,const char *,struct addrinfo,const struct addrinfo *,struct addrinfo,struct addrinfo ** )'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
这个问题是最诡异的一个了。问题三:
void (__stdcall *FreeAddrInfoEx1)(PADDRINFOEX);
void (__stdcall *FreeAddrInfoW1)(PADDRINFOW );
发生的错误:
error C2065: 'PADDRINFOEX' : undeclared identifier
error C2165: 'left-side modifier' : cannot modify pointers to data
error C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
error C2065: 'PADDRINFOW' : undeclared identifier
error C2165: 'left-side modifier' : cannot modify pointers to data
error C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
是不是少了什么头文件?问题四:
int (__stdcall *GetAddrInfoW1)(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
出现的错误:
error C2199: syntax error : found 'int (' at global scope (was a declaration intended?)
Error executing cl.exe.
好象也是数据类型发生的错误。这个问题是最多的了。
有60多个函数已经成功了,还有40多个函数有问题。
那些函数我是参考http://windowssdk.msdn.microsoft.com/en-us/library/ms741394.aspx 这里的。
好不容易攒到20分,各位大大不要嫌少呀。我带的头文件是
#include "stdio.h"
#include "Windows.h"问题一:
void (__stdcall *freeaddrinfo1)(struct addrinfo *);
发生的错误:
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information问题二:
int (__stdcall * getaddrinfo1)(const char FAR* ,const char FAR* ,const struct addrinfo FAR* ,struct addrinfo FAR** ); proc=GetProcAddress(hModule,"getaddrinfo");
getaddrinfo1= (int (__stdcall *)(const char FAR* ,const char FAR* ,const struct addrinfo FAR* ,struct addrinfo FAR** ))proc;
发生的错误:
error C2440: '=' : cannot convert from 'int (__stdcall *)(const char *,const char *,struct DllMain::addrinfo,const struct DllMain::addrinfo *,struct DllMain::addrinfo,struct DllMain::addrinfo ** )' to 'int (__s
tdcall *)(const char *,const char *,struct addrinfo,const struct addrinfo *,struct addrinfo,struct addrinfo ** )'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
这个问题是最诡异的一个了。问题三:
void (__stdcall *FreeAddrInfoEx1)(PADDRINFOEX);
void (__stdcall *FreeAddrInfoW1)(PADDRINFOW );
发生的错误:
error C2065: 'PADDRINFOEX' : undeclared identifier
error C2165: 'left-side modifier' : cannot modify pointers to data
error C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
error C2065: 'PADDRINFOW' : undeclared identifier
error C2165: 'left-side modifier' : cannot modify pointers to data
error C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
是不是少了什么头文件?问题四:
int (__stdcall *GetAddrInfoW1)(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
出现的错误:
error C2199: syntax error : found 'int (' at global scope (was a declaration intended?)
Error executing cl.exe.
好象也是数据类型发生的错误。这个问题是最多的了。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货