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

GetComputerName失败,GetLastError回来111,是什么鬼意思

2013-09-24 
GetComputerName失败,GetLastError返回111,是什么鬼意思得不到计算机名,得到1个空字符串。SHIT[解决办法]你

GetComputerName失败,GetLastError返回111,是什么鬼意思
得不到计算机名,得到1个空字符串。SHIT
[解决办法]
你的输入参数的容量太小了

#define INFO_BUFFER_SIZE 32767
  TCHAR  infoBuf[INFO_BUFFER_SIZE];
  DWORD  bufCharCount = INFO_BUFFER_SIZE;
 
  // Get and display the name of the computer. 
  bufCharCount = INFO_BUFFER_SIZE;
  if( !GetComputerName( infoBuf, &bufCharCount ) )

热点排行