When executing "ExecQuery" throwing access violation exception in C++

  • Thread starter Thread starter bhavya internship
  • Start date Start date
B

bhavya internship

Guest
Hello All,

When I am executing "ExecQuery" throwing below access violation exception:

Exception thrown at 0x00007FF7622CDA62 in Test.exe: 0xC0000005: Access violation reading location 0x00007FFFF870C890.

Below is the code snippet:

CComPtr<IEnumWbemClassObject> CTest::query(std::wstring strquery)
{
CComPtr<IEnumWbemClassObject> pWbemEnumerator;

HRESULT hres = m_services->ExecQuery(
L"WQL",
L"SELECT * FROM Win32_ComputerSystem",
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
nullptr,
&pWbemEnumerator);

Could anyone please help me how to resolve the exception.1527891.png

Continue reading...
 
Back
Top