🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #440

HtmlHelp out of resources problem

#440
From: JB
Date: Tue, 15 Apr 2008 14:57
50 lines
2173 bytes
Hi,

I am converting my application from using WinHelp to HtmlHelp.  
I have mostly got it working, but have a problem which I don�t 
understand.

My application has a main form which is always open and 
serveral other forms which can be opened from the main form, 
but in most cases only one of these additional forms can be 
open at one time.

In the set up of my main form I do the following:

HINSTANCE hHtmlHelpModule = LoadLibrary("hhctrl.ocx");

 //Get the address of the HtmlHelpA API.
 HtmlHelpFunction = (HTMLHELP)::GetProcAddress
                            (hHtmlHelpModule, "HtmlHelpA");

On most of the forms, to display the help to the user I do the 
following:

HWND hWnd;

    if (MainForm->HtmlHelpFunction)
    {
        MainForm->HelpFilename = HELPFILENAME;
        (*MainForm->HtmlHelpFunction)(hWnd, MainForm-
               >HelpFilename.c_str(), HH_HELP_CONTEXT, IDH_E1);
    }

and this works fine.

In one case I open several additional forms at once and with 
the same code I get an out of resources error message.

If instead I use the following:

    if (MainForm->HtmlHelpFunction)
    {
        MainForm->HelpFilename = HELPFILENAME;
        (*MainForm->HtmlHelpFunction)(Handle, MainForm-
         >HelpFilename.c_str(), HH_HELP_CONTEXT, IDH_E1);
    }

I don�t understand why and don�t know if the second piece of 
code is valid to use.
Any help would be appreciated.
JB
Technical Details
Message-ID: <4804c240$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ca88eda1979657b0,start
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII
From: "JB" <jo4508@yahoo.co.uk>
Sender: "JB" <jo4508@yahoo.co.uk>
Reply-To: "JB" <jo4508@yahoo.co.uk>
Subject: HtmlHelp out of resources problem
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 88.107.72.18     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4804c240$1@newsgroups.borland.com>
Date: 15 Apr 2008 07:57:04 -0700
X-Trace: newsgroups.borland.com 1208271424 207.105.83.66 (15 Apr 2008 07:57:04 -0700)
Lines: 51
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail