系统公告:2008 4.18 HiPiHi世界向公众全面开放:立即注册成为 HiPiHi世界/官方论坛 居民
论坛封面 » 建议与提案 » 问题提交与产品建议
[分页: 1] [Only the starting topics] [Pack the same topic] [Subscribe] [back]
本主题地址:http://forums.hipihi.com/main-read-63-ff8080811a7bf5d7011a84c247aa7143.html
[1thread] 主题:Re:求助 【复制本帖地址】
凤翔冰(xiangbing)
凤翔冰的HiMe
访问HiMe

post:100
elite:0
point:128
level:社会初显 初级居民
coin:100
from:北京市
register:2008-02-02
Last Login:12-22 23:23
个人档案 /虚拟档案
 

症状
当你在Microsoft Windows Server2003 或 Mircosoft Windows XP 上运行允许统一码的、使用了FreeAddrInfo Windows Sockets 函数或者用户助手类,例如,ATL::CSocketAddr 的应用程序时,你可能收到下面的错误信息:
      无法定位程序输入点FreeAddrinfoW于动态链接库WS2_32.dll上

原因
WS2_32.dll库没有输出 FreeAddrInfoW符号,你必须使用统一码版本的FreeAddrInfo函数。

解决方法
根据下面的步骤来解决这个问题:
1、把Atlsocket.h文件复制到你想使用的任意文件夹中。这个文件位于下面的目录中:
 Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include


2、在第一步中创建的Atlsocket.h中,加入下面的代码块
//Atlsocket.h
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "mswsock.lib")
//Start of Addition
#if _WIN32_WINNT < 0x0502
  #define ADDRINFOT addrinfo
  #define GetAddrInfo getaddrinfo
  #define FreeAddrInfo freeaddrinfo
#endif
//End of Addition namespace ATL

3、运行Mircosoft Visual C++


4、在工具菜单中单击选项。在选项对话框的左面,打开项目,然后单击VC++目录
 
注意:如果你使用的是Visual C++ Express版本,在选项对话框的左面,打开项目和方案,然后单击VC++目录

5、在选中包含文件栏,然后把Atlsocket.h文件的修改版本所在的目录增加到列表的顶部。


6、重新建立你的应用程序。

状况
Microsoft已经确认在Microsoft产品中存在这个bug,已经在“Applies to”章中列出

更多消息
产生该问题的步骤
1、启动Microsoft Visual Studio .NET 2003
2、打开文件菜单,指向新建,然后单击项目
3、单击项目类型下面的Visual C++项目,然后单击模板下面的Win32控制台项目
4、在名称一栏中输入Sample,单击确定
5、在Win32 应用程序向导对话框中,应用程序设置中单击选中添加支持下的ATL复选框,单击完成按钮
6、在Sample.cpp文件中,用下面的代码代替存在的默认代码。

#include "stdafx.h"
#include <atlsocket.h>

void _tmain()
{
 CSocketAddr aSocketAddr;
}

7、在解决方案资源管理器中右击项目节点,然后选择属性
8、在项目属性页对话框中,单击左面配置属性下的常规。在右面,将字符集属性设置为使用 Unicode 字符集。点击确定
9、在生成菜单中,点击生成解决方案生成应用程序。注意到在生成过程中没有编译错误或链接错误。
10、在调试菜单中,点击开始执行(不调试)。可以注意到,收到了“症状”中描述的错误信息。

应用程序碰到这个问题的解决方法:

属于系统问题,你的系统不支持IPv6,升级到SP1/SP2就能解决

    


------
此帖被 凤翔冰(xiangbing) 在 2008-06-14 19:07:35 修改过。
支持!我挖 :0 反对!我埋 :0



发帖时间:2008-06-14 19:06:43
[分页: 1] [Only the starting topics] [back]

 您未登录,请登录

HIPIHI世界用户名 密码 记住我   还不是HIPIHI世界用户?
快速回复
文章标题
文章内容
·Please confirm your remarks obey "Internet electronic bulletin service management provides" "on the maintenance of the NPC Standing Committee Internet safety requirements ",and accord with the thrust of the forum。
·Users of this community may not made remarks include which damage the Constitution and the law, undermine national unity, fabricated or distorted the facts, spread feudal superstition and obscenity, pornography, and other violations of the constitution and administrative laws and regulations of expression。
·Users of this community are in violation of the provisions of the community under the laws of the PRC and the bear.。
Google 


精彩导航
·The One链接地址
·HiTV链接地址
·e-ARTS链接地址
·说吧链接地址
·四合院交友中心链接地址
·爱民小学技术讨论区链接地址
推荐主题
·祝贺雪糕成为"新居民之"…
·这一代精英会是谁?
·"Hi火传递"号4月25日发…
·[注意]关于HiPiHi操作体…
·关于官方启用统一客服ID…
·50011版常见问题
·关于在HiPIHi中使用有限…
·线下聊天功能的试用
·饿着肚子上来发贴,提几!…
·登陆世界报错或功能使用…
精选帮助
精选帮助文章
论坛最新主题 图片版
“HiPiHi世界掠影(3D相…
Ask 问题大全 2 期
实用的人物模版新鲜出炉…
无法进入Hipihi平台或者…
HiPiHi World Interface…
HiPiHi World’s Help a…
最新显卡驱动程序
HiPiHi新人必看视频教程…
HiPiHi-中国网络虚拟生活的平台 | HiPiHi 官方居民论坛 | Contact Us
www.hipihi.com