Sha256: 1e0e812c521481a829f332ec33d82b704f439e7764bfcd0be557246d7a14eaac

Contents?: true

Size: 932 Bytes

Versions: 8

Compression:

Stored size: 932 Bytes

Contents

// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"

IUIAutomation *pAutomation ;

IUIAutomation* getGlobalIUIAutomation() {
	return pAutomation ;
}


BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH: 
	case DLL_THREAD_ATTACH:
		HRESULT hr ;
		hr = CoInitialize(NULL) ;
		if (FAILED(hr)) {
			printf("UiaDll: CoInitialize failed. hr = 0x%x", hr) ;
			return FALSE ;
		}
		hr = CoCreateInstance(__uuidof(CUIAutomation), NULL, CLSCTX_INPROC_SERVER, __uuidof(IUIAutomation), (void**)&pAutomation);
		if (FAILED(hr)) {
			printf("UiaDll: CoCreateInstance failed. hr = 0x%x", hr) ;
			return FALSE ;
		}
		break ;
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		CoUninitialize() ;
		break;
	}
	return TRUE;
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rautomation-0.7.3 ext/UiaDll/UiaDll/dllmain.cpp
rautomation-0.7.2 ext/UiaDll/UiaDll/dllmain.cpp
rautomation-0.7.1 ext/UiaDll/UiaDll/dllmain.cpp
rautomation-0.7.0 ext/UiaDll/UiaDll/dllmain.cpp
rautomation-0.6.3 ext/UiaDll/UiaDll/dllmain.cpp
rautomation-0.6.2 ext/UiaDll/UiaDll/dllmain.cpp
rautomation-0.6.1 ext/UiaDll/UiaDll/dllmain.cpp
rautomation-0.6.0 ext/UiaDll/UiaDll/dllmain.cpp