IonicWind Software

IWBasic => General Questions => Topic started by: LarryMc on July 24, 2009, 06:18:03 PM

Title: Searching Help Files
Post by: LarryMc on July 24, 2009, 06:18:03 PM
Working on a subroutine to search all the help files on my computer.

A global array holds all the .chm names.
It works great as long as the 1st help file(EBasic) contains the term searched for.

It will also find the term in another help file if it is not in the EB help.

My problem is that as it goes through the array of chm files I get a messagebox for every help file that doesn't contain the term.

Is there a way to disable the enternally generated messageboxes?

Also, when I select a term that is in one specific help file the program opens and blank help window and goes off in never-never land until I get a not enough memory message.  Any ideas there?  The other 9 help files work okay.

Below is the code that I have right now for the subroutine.

global Sub Help(win:Window,str:String)
   String msgtext,title="usersguide.chm"
int x
If root = ""
MessageBox 0,"Can't find EBasic PATH .","Error"
Return
   EndIf
   If cookie = 0 Then _HtmlHelp(0,"",HH_INITIALIZE,&cookie)
   HH_AKLINK link
   msgtext = "No topics found For "+str
   link.cbStruct =     Len(link)
   link.fReserved =    FALSE
   link.pszUrl =       NULL
   link.pszMsgText =   msgtext
   link.pszMsgTitle =  title
   link.pszWindow =    ""
   link.fIndexOnFail = False
   link.pszKeywords = str
int bfound=0
uint helphand=_HtmlHelp(0,Root+"\\help\\usersguide.chm",HH_KEYWORD_LOOKUP,&link)
if helphand=0
HH_LAST_ERROR lasterror
lasterror.cbStruct = len(HH_LAST_ERROR)
lasterror.description = L""
_HtmlHelp(NULL,"",HH_GET_LAST_ERROR,&lasterror)
if lasterror.hr <>1
for x=0 to 49
if chm[0,x]="" then breakfor
if chm[0,x]<>"usersguide.chm"
link.pszMsgTitle =  chm[0,x]
helphand=_HtmlHelp(0,Root+"\\help\\"+chm 0,x],HH_KEYWORD_LOOKUP,&link)
if helphand=0
lasterror.cbStruct = len(HH_LAST_ERROR)
lasterror.description = L""
_HtmlHelp(NULL,"",HH_GET_LAST_ERROR,&lasterror)
if lasterror.hr =1
breakfor
endif
else
bfound=1
endif
endif
next x
if((helphand = NULL) & (lasterror.hr <> 1) & !bFound)
'Messagebox d1,"No topics found",title
endif
endif
endif
return 0
EndSub


Thanks for any and all help.

Larry
Title: Re: Searching Help Files
Post by: LarryMc on July 24, 2009, 08:25:37 PM
Found my problem:
These lines
   link.pszMsgText =   msgtext
   link.pszMsgTitle =  title

should be
   link.pszMsgText =   null
   link.pszMsgTitle = null


Larry