From ce236a1ca3574f230c150dff3a5bdd447e868ea5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 24 Aug 2013 07:36:34 +0000 Subject: - correct COM expors - various fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@5804 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ShellExt/shellext_10.vcxproj | 10 +++++----- plugins/ShellExt/shellext_11.vcxproj | 24 ++++++++++++------------ plugins/ShellExt/src/ShellExt.def | 7 +++++++ plugins/ShellExt/src/Version.h | 3 --- plugins/ShellExt/src/main.cpp | 7 ++++--- plugins/ShellExt/src/options.cpp | 2 +- plugins/ShellExt/src/shlcom.cpp | 7 ++++--- 7 files changed, 33 insertions(+), 27 deletions(-) create mode 100644 plugins/ShellExt/src/ShellExt.def (limited to 'plugins/ShellExt') diff --git a/plugins/ShellExt/shellext_10.vcxproj b/plugins/ShellExt/shellext_10.vcxproj index 830c94747e..fb5ad4ccb5 100644 --- a/plugins/ShellExt/shellext_10.vcxproj +++ b/plugins/ShellExt/shellext_10.vcxproj @@ -19,7 +19,7 @@ - ShellExt + ShlExt {B27B85B5-0EF1-496D-99D7-0702A98A342A} @@ -91,7 +91,6 @@ true true Windows - 0x30040000 $(IntDir)$(TargetName).lib true true @@ -99,6 +98,7 @@ $(ProfileDir)..\..\bin10\lib /PDBALTPATH:%_PDB% mir_core.dll + src\ShellExt.def @@ -123,11 +123,11 @@ true true Windows - 0x30040000 $(IntDir)$(TargetName).lib false $(ProfileDir)..\..\bin10\lib mir_core.dll + src\ShellExt.def @@ -151,12 +151,12 @@ true true Windows - 0x30040000 $(IntDir)$(TargetName).lib false $(ProfileDir)..\..\bin10\lib /PDBALTPATH:%_PDB% mir_core.dll + src\ShellExt.def @@ -179,11 +179,11 @@ true true Windows - 0x30040000 $(IntDir)$(TargetName).lib false $(ProfileDir)..\..\bin10\lib mir_core.dll + src\ShellExt.def diff --git a/plugins/ShellExt/shellext_11.vcxproj b/plugins/ShellExt/shellext_11.vcxproj index f34657320e..8b133f32fc 100644 --- a/plugins/ShellExt/shellext_11.vcxproj +++ b/plugins/ShellExt/shellext_11.vcxproj @@ -95,13 +95,13 @@ true true Windows - 0x30040000 - $(IntDir)$(TargetName).lib true true - false $(ProfileDir)..\..\bin11\lib mir_core.dll + src\ShellExt.def + false + $(IntDir)$(TargetName).lib @@ -126,12 +126,12 @@ true true Windows - 0x30040000 - $(IntDir)$(TargetName).lib - false $(ProfileDir)..\..\bin11\lib false mir_core.dll + src\ShellExt.def + false + $(IntDir)$(TargetName).lib @@ -155,11 +155,11 @@ true true Windows - 0x30040000 - $(IntDir)$(TargetName).lib - false $(ProfileDir)..\..\bin11\lib mir_core.dll + src\ShellExt.def + false + $(IntDir)$(TargetName).lib @@ -182,11 +182,11 @@ true true Windows - 0x30040000 - $(IntDir)$(TargetName).lib - false $(ProfileDir)..\..\bin11\lib mir_core.dll + src\ShellExt.def + false + $(IntDir)$(TargetName).lib diff --git a/plugins/ShellExt/src/ShellExt.def b/plugins/ShellExt/src/ShellExt.def new file mode 100644 index 0000000000..e867b9b540 --- /dev/null +++ b/plugins/ShellExt/src/ShellExt.def @@ -0,0 +1,7 @@ +LIBRARY ShlExt + +EXPORTS +DllCanUnloadNow PRIVATE +DllGetClassObject PRIVATE +DllRegisterServer PRIVATE +DllUnregisterServer PRIVATE diff --git a/plugins/ShellExt/src/Version.h b/plugins/ShellExt/src/Version.h index 89aa117923..c2f1323bba 100644 --- a/plugins/ShellExt/src/Version.h +++ b/plugins/ShellExt/src/Version.h @@ -6,9 +6,6 @@ #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM #define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -#define __STRINGIFY(x) #x -#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS) - #define __PLUGIN_NAME "ShlExt" #define __FILENAME "ShlExt.dll" #define __DESCRIPTION "Windows Explorer extension for Miranda NG." diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index 1791fc99f8..2dea9412ed 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -48,15 +48,16 @@ private: HKEY m_key; }; -char str1[] = "shlext " __VERSION_STRING " - shell context menu support for Miranda NG"; +char str1[100]; char str2[] = "{72013A26-A94C-11d6-8540-A5E62932711D}"; char str3[] = "miranda.shlext"; char str4[] = "Apartment"; TCHAR key1[] = _T("miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}\\InprocServer32"); -HRESULT __stdcall DllRegisterServer() +STDAPI DllRegisterServer() { + sprintf_s(str1, sizeof(str1), "shlext %d.%d.%d.%d - shell context menu support for Miranda NG", __FILEVERSION_STRING); if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext", REG_SZ, str1, sizeof(str1))) return E_FAIL; if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\CLSID", REG_SZ, str2, sizeof(str2))) @@ -91,7 +92,7 @@ HRESULT __stdcall DllRegisterServer() return S_OK; } -HRESULT __stdcall DllUnregisterServer() +STDAPI DllUnregisterServer() { return RemoveCOMRegistryEntries(); } diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index 05f71ab039..1e92422fcb 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -25,7 +25,7 @@ static TCHAR* COM_OKSTR[2] = { LPGENT("Successfully created shell registration.") }; static TCHAR* COM_APPROVEDSTR[2] = { LPGENT("Not Approved"), LPGENT("Approved") }; -static LRESULT CALLBACK OptDialogProc(HWND hwndDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK OptDialogProc(HWND hwndDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { int comReg, iCheck; TCHAR szBuf[MAX_PATH]; diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index fbbf299894..11c6616116 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -1508,11 +1508,12 @@ void InvokeThreadServer() const IID CLSID_ISHLCOM = { 0x72013A26, 0xA94C, 0x11d6, {0x85, 0x40, 0xA5, 0xE6, 0x29, 0x32, 0x71, 0x1D }}; -HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { + MessageBoxA(0, "Ding!", "Dong", MB_OK); + if (rclsid == CLSID_ISHLCOM && riid == IID_IClassFactory && FindWindowA(MIRANDANAME, NULL) != 0) { *ppv = new TClassFactoryRec(); - MessageBoxA(0, "Ding!", "Dong", MB_OK); return S_OK; } @@ -1520,7 +1521,7 @@ HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) return CLASS_E_CLASSNOTAVAILABLE; } -HRESULT DllCanUnloadNow() +STDAPI DllCanUnloadNow() { if (dllobject.FactoryCount == 0 && dllobject.ObjectCount == 0) return S_OK; -- cgit v1.2.3