#define CHK_HRES(op) \
{ \
HRESULT tmp_hresult___ = op; \
if (FAILED(tmp_hresult___)) \
throw CAtlException(tmp_hresult___); \
}
void CChildDlg7::OnHyper_v(){
//CHK_HRES(pObject->Method());
CComBSTR namespacePath = L"\\\\";
CString pServer;
this->GetDlgItemText(IDC_EDIT1,pServer);
//this->GetDlgItemText(IDC_LIST1,pServer);
namespacePath = pServer;
namespacePath += L"\\root\\virtualization";
pUserName= pServer;
pPassword= pServer;
CComPtr<IWbemLocator> pWbemLocator;
CHK_HRES(pWbemLocator.CoCreateInstance( CLSID_WbemLocator,
NULL,
CLSCTX_INPROC_SERVER));
CComPtr<IWbemServices> pWbemServices;
CHK_HRES(pWbemLocator->ConnectServer(
namespacePath,
CComBSTR(pUserName),
CComBSTR(pPassword),
NULL,
0,
NULL,
NULL,
&pWbemServices
)); 现在一运行到这地方程序会崩掉,有大神帮看一下么!?