首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

关于CString 的有关问题

2012-02-09 
关于CString 的问题程序是这样的:#includestdafx.h #includeafx.h#includeiostream #includeWinine

关于CString 的问题
程序是这样的:
#include   "stdafx.h "
#include   <afx.h>

#include   "iostream "
#include   "Wininet.h "
#pragma   comment(lib, "Wininet.lib ")
using   namespace   std;

int   _tmain(int   argc,   _TCHAR*   argv[])
{
DWORD   dwFlags;
CString   ConnectKind;
if(InternetGetConnectedState(&dwFlags,0))
{
cout   < < "您已经接入internet,! " < <   endl;

dwFlags   =   dwFlags&0x07;
if(dwFlags==INTERNET_CONNECTION_LAN)
{
ConnectKind   =   "本机通过局域网接到internet ";
cout   < <   "2 " < <endl;
}
if(dwFlags==INTERNET_CONNECTION_PROXY){
ConnectKind   =   "本机通过代理接到internet ";
cout   < <   "3 " < <endl;
}    
cout   < <   ConnectKind.GetBuffer   () < <endl;
                }
else
{
        cout   < < "对不起,您还没有接入inernet,正在进行接入 " < <endl;
if(InternetAttemptConnect(0)   ==   ERROR_SUCCESS)
cout   < < "您接入了internet,祝你冲 " < <endl;

   
          }
    ConnectKind.ReleaseBuffer();
return   0;
}

为什么cout   < <   ConnectKind.GetBuffer   () < <endl;
的输出是一32位的数字呀,不应该是文字吗?

[解决办法]


所有使用VS2005的用户都要先在字符串编码类型这里过一过堂……
[解决办法]
你用的是Use Unicode Character Set
不使用Unicode的就可以了

热点排行