Recent

Author Topic: manual creation of HTMLHelpDatabase, HTMLBrowserHelpViewer  (Read 5769 times)

Martin V

  • Full Member
  • ***
  • Posts: 139
manual creation of HTMLHelpDatabase, HTMLBrowserHelpViewer
« on: June 02, 2010, 03:52:58 am »
Hello,

my application has got a main form which is created manually without using the form designer. To get help functionality, I need to create a tHTMLHelpDatabase and a tHTMLBrowserHelpViewer object manually. When executing help, my program crashes. To study my problem, I modified the examples/helphtml sample which uses these two objects via FormDesigner: I simply created these two objects manually by extending TForm1.FormCreate and the program crashes, too:

Original sample code, Initializing HTMLHelpDatabase1 and HTMLBrowserHelp1 via Form designer, works fine:
Code: [Select]
procedure TForm1.FormCreate(Sender: TObject);
begin
  HTMLHelpDatabase1.BaseURL:='file://html';
end;

Manual initialization with assigning all designer properties manually, crashes when executing help
Code: [Select]
procedure TForm1.FormCreate(Sender: TObject);
begin
  LazhelpHTML.Register; {is this necessary? AutoRegister has been set to true via designer for both objects}
  HTMLBrowserHelpViewer1 := tHTMLBrowserHelpViewer(self);
  HtmlBrowserHelpViewer1.BrowserParams := '%s';
  HtmlBrowserHelpViewer1.BrowserPath := '';
  HTMLHelpDatabase1 := tHTMLHelpDatabase(self);
  HTMLHelpDatabase1.KeywordPrefix := 'HTML/';
  HTMLHelpDatabase1.BaseURL:='file://html';
end;

What do I have made wrong? Where can I see what initializations are made when initializing the two objects via form designer?

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: manual creation of HTMLHelpDatabase, HTMLBrowserHelpViewer
« Reply #1 on: June 03, 2010, 06:27:39 am »
 %)  Oops, I forgot .Create! This bug is nearly invisible, sorry, and the compiler accepts it.
Code: [Select]
HTMLBrowserHelpViewer1 := tHTMLBrowserHelpViewer.CREATE(self);

 

TinyPortal © 2005-2018