getsysteminfo.cpp

来自「Vc.Net入门与提高源码」· C++ 代码 · 共 19 行

CPP
19
字号
// DGetSystemInfo.cpp : Implementation of CDGetSystemInfo

#include "stdafx.h"
#include "GetSystemInfo.h"


// CDGetSystemInfo


STDMETHODIMP CDGetSystemInfo::GetMyComputerName(BSTR* pComputerName)
{   USES_CONVERSION;
	TCHAR lpBuffer[MAX_PATH];
	if(pComputerName==NULL)return E_INVALIDARG;
	DWORD len=MAX_PATH;
	::GetComputerName(lpBuffer,&len);
	*pComputerName=T2BSTR(lpBuffer);
    return S_OK;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?