Error opening file in Win10 Modern app launched from desktop C++

3

I'm trying to open an image file with the Windows 10 Photos app (which is a 'modern' app) from desktop C++ using the following code (error checks omitted for simplicity):

DWORD pid;
CComPtr<IApplicationActivationManager> paam;
CoCreateInstance(CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER, IID_PPV_ARGS(&paam));
CoAllowSetForegroundWindow(paam, NULL);
paam->ActivateForFile(pwszAppUserModelId, psia, L"open", &pid);

pwszAppUserModelId is the app user model ID for the Photos app. psia is a pointer to an IShellItemArray that contains a single IShellItem for an image file (PNG).

ActivateForFile is returning error 0x80270255:

'This app has multiple extensions registered to support the specified contract. Activation by AppUserModelId is ambiguous.'

Any tips on how to fix this? TIA.

c++
windows-10
launching-application
asked on Stack Overflow Feb 14, 2016 by chrisd • edited Feb 15, 2016 by chrisd

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0