🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Registering Help Viewer

#8609
From: 3 Wishes
Date: Thu, 07 Oct 2004 21:40
70 lines
3409 bytes
I am lost and I do not know how to deal with that.

I tried to define a new type of help viewer (in fact tried to interface the 
HTMLHelp with C++ Builder).
I have defined a class THtmlHelpViewer to deal with the problem... Here is 
the snipet of relevant information for the class itself

HEADER:
class THtmlHelpViewer : public TInterfacedObject
{
(...)
protected:
    IHelpManager* fiHelpManager;
(...)
public:
    __property IHelpManager* iHelpManager = {read = fiHelpManager, write = 
fiHelpManager};
(...)
};

SOURCE:
(...)
void InitServices()
{
  IHtmlHelpViewer = 
dynamic_cast<ICustomHelpViewer*>((ICustomHelpViewer*)HtmlHelpViewer);
  IHtmlHelpViewer->AddRef();
  Helpintfs::RegisterViewer(IHtmlHelpViewer, ????);
  Application->HelpSystem->AssignHelpSelector((IHelpSelector*) 
HtmlHelpViewer);
}
#pragma startup InitServices
(...)

I am lost because I do not know how to pass the second parameter for 
RegisterViewer.
The online help says that the paramater is a reference to a 
_di_IHelpManager, but the developper's guide (7-32) says that the second 
parameter is an IHelpManager...

So if I try to call RegisterViewer(IHtmlHelpViewer, 
HtmlHelpViewer->iHelpManager) I have the two following errors:
 [C++ Warning] UnitHTMLHelp.cpp(19): W8030 Temporary used for parameter 
'Manager' in call to '_fastcall 
RegisterViewer(_di_ICustomHelpViewer,_di_IHelpManager &)'
 [C++ Error] systobj.h(256): E2193 Too few parameters in call to '_fastcall 
IHelpManager::Release(const int)'

If I try on the other hand to call RegisterViewer(IHTMLHelpViewer, 
*(HtmlHelpViewer->iHelpManager)) I have then the following errors
  [C++ Warning] UnitHTMLHelp.cpp(19): W8030 Temporary used for parameter 
'Manager' in call to '_fastcall 
RegisterViewer(_di_ICustomHelpViewer,_di_IHelpManager &)'
 [C++ Error] UnitHTMLHelp.cpp(19): E2064 Cannot initialize '_di_IHelpManager 
&' with 'IHelpManager'
 [C++ Error] UnitHTMLHelp.cpp(19): E2342 Type mismatch in parameter 
'Manager' (wanted '_di_IHelpManager &', got 'IHelpManager')

and if I try the following call Helpintfs::RegisterViewer(IHtmlHelpViewer, 
(_di_IHelpManager&)(HtmlHelpViewer->iHelpManager)) I have of course no error 
at the compilation, who would with a "dirty cast" like this, but the system 
just go ballistic at the execution.



Notice I do not want to have a temporary parameter for 'Manager' as I need 
to get that value...I do not know how to deal with that situation... please 
someone help me! ;)

Thanks for your comments... 
Technical Details
Message-ID: <4165b82e$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newshosting.com!nx02.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fa848f661129ced4,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "3 Wishes" <3@wishes.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Registering Help Viewer
Date: Thu, 7 Oct 2004 17:40:21 -0400
Lines: 72
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: <4165b82e$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1097185326 64.223.183.32 (7 Oct 2004 14:42:06 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newshosting.com!nx02.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail