Version 4.7 HtmlExe

I am no longer able to dynamically load the TOC from a generated XML file (it used to work in Version 4.6. The file is present in the source folder, is extracted to a temporary location but is not loaded on using the LoadTOCfromXMLFile function (see below). Instead, the default TOC in the .hepx file is loaded.

function OnPubLoaded: Boolean;

// When the publication is starting.

// Set Result to True if you want to exit immediately without any warning.

tocfile := UnpackTemporaryResource(“toc.xml”);

//MessageBox("The TOC is: " + tocfile, “TOC”, MB_OK+MB_ICONINFORMATION);


Result := False;


Move your code from the OnPubLoaded event to this new one:

procedure OnStartMainWindow;  

OnPubLoaded is fired too soon; after, the publication loads the default TOC, ignoring your previous load.