Can't open help file as Windows 10 Universal application

846 views Asked by At

I've just used Desktop Bridge to package three MFC applications for uploading to the Windows Store.

They all work fine but for some reason one of them is unable to open the help file. (Help works fine in the other two applications.)

The problem application works perfectly when run from Visual Studio or by double clicking the executable. But accessing help gives me the following error after being installed from the test AppX package.

Failed to launch help.

I'm able to use Task Manager to locate the installed application location and confirmed that it does contain my help file. In addition, I added code to display the path of the help file on start up, and it displays the correct help path! But no matter what I do, my application cannot bring up help.

Does anyone know if there is anything about the limited privileges of being installed as a Windows 10 app that could somehow limit access to the help file? Or can anyone suggest how to get past the completely useless error message above to get a hint about why it is failing?

1

There are 1 answers

6
Stefan Wick  MSFT On

You get this error because the .chm file that contains your help content is located in your applications install folder. In the modern Windows app model that folder is locked down so that only processes that are part of your app package can access it. With the MFC framework, however, the help viewer that gets invoked is not part of your package - therefore it can't access the .chm file.

Solution is for your app at runtime (e.g. right after launch) to make a copy of the .chm file in an accessible location (e.g. %TEMP%) and update m_pszHelpFilePath to point to that location. Now the help viewer process should be able to load the help successfully.