Question, I have both a parent dialog and a DLL called from the parent. If I open a CHM file using the following code, and then open a different help file from the DLL (different file but same call encapsulated in the DLL), the application hangs. Can anyone suggest why this is or a remediation?
thanks
regards
Dean
thanks
regards
Dean
Code:
' Derived from: http://www.powerbasic.com/support/forums/Forum4/HTML/002083.html ' see also: http://www.powerbasic.com/support/forums/Forum7/HTML/000314.html 'Include HtmlHelp.inc file to setup HtmlHelp equates like %HH_HELP_CONTEXT #INCLUDE "htmlhelp.inc" ' provided as part of PB DECLARE FUNCTION HtmlHelp LIB "hhctrl.ocx" ALIAS "HtmlHelpA" ( BYVAL hwndCaller AS DWORD , _ pszFile AS ASCIIZ , _ BYVAL uCommand AS LONG , _ BYVAL dwData AS LONG ) AS LONG DECLARE FUNCTION HtmlHelp_ByKeyword(hDlg AS LONG , _ S_FileName_HtmlHelp AS STRING , _ S_HTMLHelp_Keyword AS STRING ) AS LONG FUNCTION HtmlHelp_ByKeyword(hDlg AS LONG , _ S_FileName_HtmlHelp AS STRING , _ S_HTMLHelp_Keyword AS STRING ) AS LONG ' Generate STRPTR from keyword ' Derived from http://www.powerbasic.com/support/forums/Forum7/HTML/000314.html ' General usage is as follows: ' HtmlHelp_ByKeyword CBHNDL, S_FilePath_FTEAgent + "FTEAgent.chm" , "Activating the Agent" DIM A_FileName_HtmlHelp AS ASCIIZ*255 DIM A_HTMLHelp_Keyword AS ASCIIZ*255 DIM hlk AS HH_AKLINK A_HTMLHelp_Keyword = S_HTMLHelp_Keyword hlk.cbStruct = SIZEOF(hlk) hlk.fReserved = %FALSE hlk.pszKeywords = VARPTR(A_HTMLHelp_Keyword) hlk.pszUrl = %NULL hlk.pszMsgText = %NULL hlk.pszMsgTitle = %NULL hlk.pszWindow = %NULL hlk.fIndexOnFail = %TRUE A_FileName_HtmlHelp = S_FileName_HtmlHelp HtmlHelp hDlg, A_FileName_HtmlHelp, %HH_KEYWORD_LOOKUP , BYREF hlk END FUNCTION #IF 00 ' Usage example HtmlHelp CBHNDL, A_FileName_Help_CHM, 00 , 00 ' to display the default listing HtmlHelp CBHNDL, A_FileName_Help_CHM, %HH_HELP_CONTEXT, 10 ' to display unit number 10 ' keywork pointer type, just for reference, resides in the htmlhelp.inc file TYPE HH_AKLINK cbStruct AS LONG fReserved AS LONG pszKeywords AS ASCIIZ PTR pszUrl AS ASCIIZ PTR pszMsgText AS ASCIIZ PTR pszMsgTitle AS ASCIIZ PTR pszWindow AS ASCIIZ PTR fIndexOnFail AS LONG END TYPE ' Call by strptr keyword DIM A_HTMLHelp_Keyword AS ASCIIZ*255 DIM hlk AS HH_AKLINK A_HTMLHelp_Keyword = "About FTE" hlk.cbStruct = SIZEOF(hlk) hlk.fReserved = %FALSE hlk.pszKeywords = VARPTR(A_HTMLHelp_Keyword) hlk.pszUrl = %NULL hlk.pszMsgText = %NULL hlk.pszMsgTitle = %NULL hlk.pszWindow = %NULL hlk.fIndexOnFail = %TRUE A_FileName_FTEAgentHelp = S_FilePath_FTEAgent + "Help FTE Agent.chm" HtmlHelp CBHNDL, A_FileName_FTEAgentHelp, %HH_KEYWORD_LOOKUP, BYREF hlk ' Also taken from the htmlhelp.inc file: ' Commands to pass to HtmlHelp() %HH_DISPLAY_TOPIC = &H0000 %HH_HELP_FINDER = &H0000 ' WinHelp equivalent %HH_DISPLAY_TOC = &H0001 %HH_DISPLAY_INDEX = &H0002 %HH_DISPLAY_SEARCH = &H0003 %HH_SET_WIN_TYPE = &H0004 %HH_GET_WIN_TYPE = &H0005 %HH_GET_WIN_HANDLE = &H0006 %HH_ENUM_INFO_TYPE = &H0007 ' Get Info type name, call repeatedly to enumerate, -1 at end %HH_SET_INFO_TYPE = &H0008 ' Add Info type to filter. %HH_SYNC = &H0009 %HH_RESERVED1 = &H000A %HH_RESERVED2 = &H000B %HH_RESERVED3 = &H000C %HH_KEYWORD_LOOKUP = &H000D %HH_DISPLAY_TEXT_POPUP = &H000E ' display string resource id or text in a popup window %HH_HELP_CONTEXT = &H000F ' display mapped numeric value in dwData %HH_TP_HELP_CONTEXTMENU = &H0010 ' text popup help, same as WinHelp %HELP_CONTEXTMENU %HH_TP_HELP_WM_HELP = &H0011 ' text popup help, same as WinHelp %HELP_WM_HELP %HH_CLOSE_ALL = &H0012 ' close all windows opened directly or indirectly by the caller %HH_ALINK_LOOKUP = &H0013 ' ALink version of %HH_KEYWORD_LOOKUP %HH_GET_LAST_ERROR = &H0014 ' not currently implemented ' See HHERROR.h [*** PB note: the Windows SDK has no such file] %HH_ENUM_CATEGORY = &H0015 ' Get category name, call repeatedly to enumerate, -1 at end %HH_ENUM_CATEGORY_IT = &H0016 ' Get category info type members, call repeatedly to enumerate, -1 at end %HH_RESET_IT_FILTER = &H0017 ' Clear the info type filter of all info types. %HH_SET_INCLUSIVE_FILTER = &H0018 ' set inclusive filtering method for untyped topics to be included in display %HH_SET_EXCLUSIVE_FILTER = &H0019 ' set exclusive filtering method for untyped topics to be excluded from display %HH_INITIALIZE = &H001C ' Initializes the help system. %HH_UNINITIALIZE = &H001D ' Uninitializes the help system. %HH_SET_QUERYSERVICE = &H001E ' Set the Host IQueryService interface %HH_PRETRANSLATEMESSAGE = &H00fd ' Pumps messages. (%NULL, %NULL, MSG PTR). %HH_SET_GLOBAL_PROPERTY = &H00fc ' Set a global property. (%NULL, %NULL, HH_GPROP) #ENDIF
Comment