Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

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:

C++
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) 
		{
			ret = 1;
			CoUninitialize();
		}
	}
	catch(...)
	{
	}
}


Do you have any suggestion how to fix this problem?

Thank you!
Posted
Comments
Legor 31-Mar-14 7:06am    
"Program crashes" is not a good error description. Please improve your question with more details.

1 solution

Thanks for the reply. It seems that Automation works only on Windows XP with SP3 and Platform Update for Windows Vista [desktop apps only] - and the machine that I was using for test did not include Platform Update for Windows Vista.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900