🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Registering Help Viewer

#8616
From: 3 Wishes
Date: Fri, 08 Oct 2004 20:08
52 lines
3306 bytes
Hi Remy,

"I do not recommend that you do that at all.  For one thing, malloc() will 
not call _di_IHelpManager's constructor, so the _di_IHelpManager instance 
will remain uninitialized and you will have undefined behavior when you try 
to use it. Again, there should not be any reason for the error to begin 
with, since there is a public Release(void) method inherited from IUnknown."

Yes, I do not like it either, but the problem persist with the Release 
function, making it an issue to compile the code itself. Where I am saved 
somewhere, is that all those interface are nevertheless structures 
apparently, without any constructor at all, so rouglhly it just seems to be 
a block of memory of the proper size. The bad thing, is that by allowing 
that block, I do not increment the reference counter either, but I think 
that this is done by passing the reference of my interface to the 
RegisterViewer method. I am agree with you although, that this is far from 
being ideal, and maybe I should try to see if there is another solution to 
fix that piece of code.


"Where is WinHelpTester declared?"

WinHelpTester is defined in the header WinHelpViewer.hpp (and digged 
somewhere in the vcl I guess...). In the VCL, winhelptester is not 
initialized, so I do it with my own tester instead.

{WinHelpViewer.pas}
initialization
  HelpViewer := TWinHelpViewer.Create;
  HelpIntfs.RegisterViewer(HelpViewer, HelpViewer.FHelpManager);
  WinHelpTester := nil;
finalization
  if Assigned(HelpViewer.FHelpManager) then
  begin
    HelpViewer.InternalShutDown;
  end;
  if Assigned(WinHelpTester) then
  begin
    WinHelpTester := nil;
  end;
end.

This is the only way that I found so far that allows me to deal with the 
context help with my viewer, downgrading "artificially" the capabilities of 
the WinHelpViewer, thus having my HtmlHelpViewer being the only one of the 
viewers installed to be able to process some requests (particulary the topic 
search).

Remark: If you read my code, you will notice that it is pretty close from 
WinHelpViewer.pas, although it is written in C++ instead of Delphi.

Many thanks for your comments. 
Technical Details
Message-ID: <4166f436$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4165b82e$2@newsgroups.borland.com> <4165c3bb$1@newsgroups.borland.com> <4165d4c5@newsgroups.borland.com> <4165d89f$1@newsgroups.borland.com> <4165da2a$1@newsgroups.borland.com> <4166370b@newsgroups.borland.com> <4166cdff@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fa848f661129ced4
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "3 Wishes" <3@wishes.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4165b82e$2@newsgroups.borland.com> <4165c3bb$1@newsgroups.borland.com> <4165d4c5@newsgroups.borland.com> <4165d89f$1@newsgroups.borland.com> <4165da2a$1@newsgroups.borland.com> <4166370b@newsgroups.borland.com> <4166cdff@newsgroups.borland.com>
Subject: Re: Registering Help Viewer
Date: Fri, 8 Oct 2004 16:08:50 -0400
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 64.223.183.32
Message-ID: <4166f436$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1097266230 64.223.183.32 (8 Oct 2004 13:10:30 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail