简体   繁体   中英

Automation crash on XP with latest sp3 and updates

I have a class that is using Windows Automation. It works fine on newer OSs (like 7 - 8 and 8.1) but on Windows XP (using SP3 and latest updates it crashes).

The code that produces the crash is:

void CUIAutomationClient::Initialize()
{
  try
  {
    CoInitialize(NULL);
    HRESULT hr; 
    hr = CoCreateInstance(__uuidof(CUIAutomation), NULL,
             CLSCTX_INPROC_SERVER,
             __uuidof(IUIAutomation),
             (void **)&g_Automation);
    if(FAILED(hr) || g_Automation==NULL) 
    {
      CoUninitialize();
    }
  }
  catch(...)
  {
  }
}

Do you have any suggestion how to fix this problem?

Thank you!

The requirements section of the MSDN documentation states the following minimum requirements:

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista, Windows XP with SP3 and Platform Update for Windows Vista [desktop apps only]

It seems quite plausible that you have not installed the Platform Update.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM