Re: wxIDE & EuHTHelp.exw
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Feb 06, 2006
- 490 views
Pete Lomax wrote: > > I need to either de-win32lib Brians' wrap of hhctrl.ocx to use a chm > file and/or wrap the WinHelp API to use .hlp files. I have searched > the archives and cannot find much evidence of success with it. > Otherwise it will just open on the index. > I use the htmlhelp facilities of windows in Tbrowse, which is part of EuCOM. To simply open something up is fairly easy if you know the context index. Below is the relevant code that is used (there is a COM call that gets the file and the context.
-- HtmlHelp function for opening context sensitive help constant hh = open_dll( "hhctrl.ocx" ), HtmlHelp = define_c_func( hh, "HtmlHelpA", {C_UINT, C_POINTER, C_UINT, C_LONG}, C_LONG), HH_DISPLAY_TOPIC = 0, HH_HELP_CONTEXT = #F -- see if there is a helpfile helpfile = invoke( {memberinfo, mi_vtbl}, {"HelpFile"}, {},{}, DISPATCH_PROPERTYGET ) if length( helpfile ) then -- get the helpcontext helpcontext = invoke( {memberinfo, mi_vtbl}, {"HelpContext"}, {}, {}, DISPATCH_PROPERTYGET ) if HtmlHelp = -1 then warnErr( "Couldn't open HtmlHelp (hhctrl.ocx)") else -- open the help file to the right spot pszFile = mem:w32acquire_mem( 0, helpfile ) void = c_func( HtmlHelp, {0, pszFile, HH_HELP_CONTEXT, helpcontext} ) mem:w32release_mem( pszFile ) end if else void = message_box( "There is no context-sensitive help " & "available for this topic.", "Help", 0) end if
Matt Lewis