summaryrefslogtreecommitdiffstats
path: root/PC/pyshellext.cpp
diff options
context:
space:
mode:
authorNikita Nemkin <nikita@nemkin.ru>2020-06-23 23:32:23 (GMT)
committerGitHub <noreply@github.com>2020-06-23 23:32:23 (GMT)
commitbbf36e8903f8e86dcad8131c818e122537c30f9e (patch)
tree5035803018a68426c52c73a21f2a2abea41659f4 /PC/pyshellext.cpp
parent90ed8a6d71b2d6e0853c14e8e6f85fe730a4329a (diff)
downloadcpython-bbf36e8903f8e86dcad8131c818e122537c30f9e.zip
cpython-bbf36e8903f8e86dcad8131c818e122537c30f9e.tar.gz
cpython-bbf36e8903f8e86dcad8131c818e122537c30f9e.tar.bz2
bpo-41070: Simplify pyshellext.dll build (GH-21037)
Replace MIDL-generated file with manual GUID definition. Use the same .def file for release and debug builds. Update setup build to support latest toolset
Diffstat (limited to 'PC/pyshellext.cpp')
-rw-r--r--PC/pyshellext.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/PC/pyshellext.cpp b/PC/pyshellext.cpp
index 0198802..ffca169 100644
--- a/PC/pyshellext.cpp
+++ b/PC/pyshellext.cpp
@@ -12,15 +12,14 @@
#include <olectl.h>
#include <strsafe.h>
-#include "pyshellext_h.h"
-
#define DDWM_UPDATEWINDOW (WM_USER+3)
static HINSTANCE hModule;
static CLIPFORMAT cfDropDescription;
static CLIPFORMAT cfDragWindow;
-static const LPCWSTR CLASS_SUBKEY = L"Software\\Classes\\CLSID\\{BEA218D2-6950-497B-9434-61683EC065FE}";
+#define CLASS_GUID "{BEA218D2-6950-497B-9434-61683EC065FE}"
+static const LPCWSTR CLASS_SUBKEY = L"Software\\Classes\\CLSID\\" CLASS_GUID;
static const LPCWSTR DRAG_MESSAGE = L"Open with %1";
using namespace Microsoft::WRL;
@@ -121,8 +120,7 @@ HRESULT FilenameListCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, LPCWSTR psz
return hr;
}
-
-class PyShellExt : public RuntimeClass<
+class DECLSPEC_UUID(CLASS_GUID) PyShellExt : public RuntimeClass<
RuntimeClassFlags<ClassicCom>,
IDropTarget,
IPersistFile
@@ -483,7 +481,7 @@ public:
}
STDMETHODIMP GetClassID(CLSID *pClassID) {
- *pClassID = CLSID_PyShellExt;
+ *pClassID = __uuidof(PyShellExt);
return S_OK;
}
};