[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

Problem using CWinApp::WinHelp( )

If I write to a file on my floppy drive thru my program, eject the floppy disk, and then i programatically try launch help using CWinApp::WinHelp() with a correct help file path in place in m_pszHelpFilePath, it fails  to launch winhelp.

Tracing thru debug thru MFC, it seems CWnd::WinHelp() fails at call to the windows function ::WinHelp() and results in prompting a messagebox with message "Unable to launch help" using
AFX_IDP_FAILED_TO_LAUNCH_HELP

Note that this doesnt happen till I write to the floppy drive and eject the floppy disk. I see exact same behaviour with Microsoft word. If I save a document to a:, eject and then click on contents and index in help, it never launches.

I have similar problem with printing a report too.

Any help would be greatly appreciated.
0
ndewagan
Asked:
ndewagan
1 Solution
 
s_stirleyCommented:
It's probably a bug in MFC, try calling _chdir to change the default drive to a known drive (like c:\) before calling WinHelp.
How many times have you seen the browse dialog go mental when it tries to go back to the last place it was open if that was a floppy .. :)

Simon.
0
 
ndewaganAuthor Commented:
You know, that works. Seems like there is no better solution.

Thanks
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now