How to use CppWinRT 3.0 for C++ dll project #1591
-
|
I have a C++ dll project which provide the context menu to Windows which do not have the I introduce the CppWinRT because I need to access the MSIX resource using WinRT API, for example, access the locale string through #include <winrt/Windows.ApplicationModel.h>
#include <winrt/Windows.ApplicationModel.Resources.Core.h>In CppWinRT 2.0, it works fine. I include the header in I have already config the project properly as the guidance <PropertyGroup>
<CppWinRTBuildModule>true</CppWinRTBuildModule>
</PropertyGroup>
<ClCompile>
<BuildStlModules>true</BuildStlModules>
</ClCompile>To implement the context menu, my project looks like this struct __declspec(uuid("<UUID Here>")) MyContextMenu : public RuntimeClass<RuntimeClassFlags<ClassicCom | InhibitFtmBase>, IExplorerCommand>
{
public:
IFACEMETHODIMP Invoke(IShellItemArray* psiItemArray, IBindCtx* pBindContext) override;
IFACEMETHODIMP GetIcon(IShellItemArray* psiItemArray, LPWSTR* ppszIcon) override;
IFACEMETHODIMP GetFlags(EXPCMDFLAGS* pFlags) override;
IFACEMETHODIMP GetTitle(IShellItemArray* psiItemArray, LPWSTR* ppszName) override;
IFACEMETHODIMP GetToolTip(IShellItemArray* psiItemArray, LPWSTR* ppszInfoTip) override;
IFACEMETHODIMP GetState(IShellItemArray* psiItemArray, BOOL fOkToBeSlow, EXPCMDSTATE* pCmdState) override;
IFACEMETHODIMP GetCanonicalName(GUID* pguidCommandName) override;
IFACEMETHODIMP EnumSubCommands(IEnumExplorerCommand** ppEnum) override;
}Could anyone tell me how to migrate to CppWinRT 3.0 ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You should try cleaning the project cache, because the generation of ixx files occurs in the early stage of the build. |
Beta Was this translation helpful? Give feedback.
You should try cleaning the project cache, because the generation of ixx files occurs in the early stage of the build.