From 45eb21022080de7f33e042880d21118ca0cbef75 Mon Sep 17 00:00:00 2001 From: Alessandro Menezes Date: Fri, 6 Jan 2017 07:59:48 -0300 Subject: [PATCH] Fix: remove ole32.dll references --- GenericFFBDriver/Registrar.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/GenericFFBDriver/Registrar.h b/GenericFFBDriver/Registrar.h index dced03d..472b352 100644 --- a/GenericFFBDriver/Registrar.h +++ b/GenericFFBDriver/Registrar.h @@ -52,17 +52,11 @@ class CRegistrar bool StrFromCLSID(REFIID riid,LPSTR strCLSID) { - LPOLESTR pOleStr = NULL; - HRESULT hr = ::StringFromCLSID(riid,&pOleStr); - if(FAILED(hr)) - return false; - int bytesConv = ::WideCharToMultiByte(CP_ACP,0,pOleStr,(int)wcslen(pOleStr),strCLSID,MAX_PATH,NULL,NULL); - CoTaskMemFree(pOleStr); - strCLSID [ bytesConv ] = '\0'; - if(!bytesConv) - { - return false; - } + sprintf_s(strCLSID, MAX_PATH, "{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}", + riid.Data1, riid.Data2, riid.Data3, + riid.Data4[0], riid.Data4[1], riid.Data4[2], riid.Data4[3], + riid.Data4[4], riid.Data4[5], riid.Data4[6], riid.Data4[7]); + return true; } public: