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:
procedure TForm1.FormCreate(Sender: TObject);
begin
HTMLHelpDatabase1.BaseURL:='file://html';
end;
Manual initialization with assigning all designer properties manually, crashes when executing help
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?