From c0e55e840056c39f5c190cf1a64c339a6631327c Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 30 Aug 2012 22:23:02 +0000 Subject: [PATCH] * main.cc: Remove CINTERFACE define. (main_display): Use C++ syntax for COM. * mklink2.cc: Remove CINTERFACE define. (make_link_2): Use C++ syntax for COM. --- ChangeLog | 8 ++++++++ main.cc | 7 +++---- mklink2.cc | 13 ++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index a99bdcb5..31151036 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-08-30 Jacek Caban + Yaakov Selkowitz + + * main.cc: Remove CINTERFACE define. + (main_display): Use C++ syntax for COM. + * mklink2.cc: Remove CINTERFACE define. + (make_link_2): Use C++ syntax for COM. + 2012-08-21 Christopher Faylor * setup.exe.manifest: Reorder "supportedOS" entries and add entry for diff --git a/main.cc b/main.cc index e37cd3bb..e731d2ff 100644 --- a/main.cc +++ b/main.cc @@ -33,7 +33,6 @@ static const char *cvsid = #undef _WIN32_WINNT #define _WIN32_WINNT 0x0501 -#define CINTERFACE #include "win32.h" #include #include "shlobj.h" @@ -161,8 +160,8 @@ main_display () // done later, in the thread which actually creates the shortcuts. extern IShellLink *sl; CoInitializeEx (NULL, COINIT_APARTMENTTHREADED); - HRESULT res = CoCreateInstance (&CLSID_ShellLink, NULL, - CLSCTX_INPROC_SERVER, &IID_IShellLink, + HRESULT res = CoCreateInstance (CLSID_ShellLink, NULL, + CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *) & sl); if (res) { @@ -209,7 +208,7 @@ main_display () // Uninitalize COM if (sl) - sl->lpVtbl->Release (sl); + sl->Release (); CoUninitialize (); } diff --git a/mklink2.cc b/mklink2.cc index 57c54369..d475e266 100644 --- a/mklink2.cc +++ b/mklink2.cc @@ -1,4 +1,3 @@ -#define CINTERFACE #include #include #include "win32.h" @@ -29,16 +28,16 @@ make_link_2 (char const *exepath, char const *args, char const *icon, char const WCHAR widepath[MAX_PATH]; if (sl) { - sl->lpVtbl->QueryInterface (sl, &IID_IPersistFile, (void **) &pf); + sl->QueryInterface (IID_IPersistFile, (void **) &pf); - sl->lpVtbl->SetPath (sl, exepath); - sl->lpVtbl->SetArguments (sl, args); - sl->lpVtbl->SetIconLocation (sl, icon, 0); + sl->SetPath (exepath); + sl->SetArguments (args); + sl->SetIconLocation (icon, 0); MultiByteToWideChar (CP_ACP, 0, lname, -1, widepath, MAX_PATH); - pf->lpVtbl->Save (pf, widepath, TRUE); + pf->Save (widepath, TRUE); - pf->lpVtbl->Release (pf); + pf->Release (); } } -- 2.43.5