CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: WinHelp() does not work on Win NT?

  1. #1
    Join Date
    Mar 2003
    Location
    The Netherlands
    Posts
    586

    WinHelp() does not work on Win NT?

    Hi,

    In my application i use the WinHelp() function to display a help file. With Windows 95 and 98 this works fine, however with Windows NT it doesn't. The message i get from Window NT is:
    "THIS FILE IS NOT A WINDOWS HELP FILE, A NEWER VERSION OF HELP IS NEEDED TO READ THIS HELP FILE".

    The following is a fragment from the code how i implemented the help. Is there a different way to do this in Windows NT?

    Code:
    #define HELP_FILE	"Help1_9.hlp"
    
    void Frame::OnHelpContents(void)
    {
     	CString Path;
     	CCPCApp* pApp = (CCPCApp*)AfxGetApp();
     	if(pApp)
     	{
     		pApp->GetPath(Path);
     	 	Path += HELP_FILE;
     	 	
     	 	::WinHelp(	this->m_hWnd,					Path,
    				HELP_CONTENTS,
    				0);
    	} 	 				
     	
    }
    Time is fun when you're having flies

  2. #2
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939
    This is a problem in NT itself. We have the same problem for our helpfiles. Its because NT uses the default help renderer which is different. If you double click on your help file or open it through the start menu (if you have a shortcut) NT uses the right program. It only gets it wrong when you start it from in code. I never eally looked further into it than that.
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

  3. #3
    Join Date
    Mar 2003
    Location
    The Netherlands
    Posts
    586
    Allright, but what did you do about it then, used different help or program does not work on NT?
    Time is fun when you're having flies

  4. #4
    Join Date
    Sep 2002
    Location
    14 39'19.65"N / 121 1'44.34"E
    Posts
    9,815
    Why are you using ::WinHelp() instead of CWinAPP::WinHelp()? The latter works under NT (but I didn't verify this for a long time, as we have moved to HTMLHelp() a few years ago).

  5. #5
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939
    Because of limit resources at the time, we just advised our users to open the help file manually. From that point on, the winhelp topic would work correctly. We got away with this as we do not have very many users of our software ( < 200 most of which were not on NT)
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

  6. #6
    Join Date
    Mar 2003
    Location
    The Netherlands
    Posts
    586
    Why are you using ::WinHelp() instead of CWinAPP::WinHelp()?
    I could not get CWinApp::WinHelp() to call the right help file. It is allready linked to another helpfile (the help file of the app).

    I used ::WinHelp() instead because i have a different frame with corresponding view for which i have created a specific helpfile.
    Time is fun when you're having flies

  7. #7
    Join Date
    Mar 2003
    Location
    The Netherlands
    Posts
    586
    Possible workaround for Winhelp() problem in Windows NT:

    Code:
    void CRoroFrame::OnRoroHelpContents(void)
    {
      ShellExecute( m_hWnd, // Parent window 
     	      NULL,           // Perform "open" action
     	      "Winhlp32.exe", // File name to open
     	      RORO_HELP_FILE, // Parameters 			      Path,		// Default directory
     	      SW_SHOW);	// Show window normally 
    }
    Time is fun when you're having flies

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)