1. WinHelp Help Please
Has _anyone_ been able to get WinHelp to work?
I've tried all sorts of ways, no errors, but nothing ever happens.
-- WinHelp commands:
constant HELP_CONTEXT = #0001,
HELP_QUIT = #0002,
HELP_INDEX = #0003 -- etc
atom user32, winhelp
user32 = open_dll("user32.dll")
if user32 = 0 then
puts(1,"Error opening user32")
abort(1)
end if
winhelp = define_c_proc(user32,"WinHelpA",{C_INT,C_POINTER,C_INT,C_INT})
if winhelp = -1 then
puts(1,"Error finding WinHelp")
abort(2)
end if
global procedure GetHelp(atom whandle, sequence filename, atom command,
atom data)
atom pStr
pStr = allocate_string(filename)
c_proc(winhelp,{whandle, pStr, command, data})
free(pStr)
end procedure
GetHelp(Win,"CALC.HLP",HELP_INDEX,0) -- does nothing when called like
this
I also tried it as define_c_func, and c_func, with the same zero
results.
What am I doing wrong?
TIA
Irv
2. Re: WinHelp Help Please
Yes, acually I have got it to work, with Liberty BASIC and Euphoria. You
have to search your system to find the "area" which calls WinHelp. I don't
have any source code to it, because I don't use WinHelp. Goto
http://world.std.com/~carlg/ and download Liberty BASIC and look at the
examples "calldll*.bas". Shouldn't be hard to port the code to Euphoria.
- Nate Brooman
[nateb at log.on.ca]
-----Original Message-----
From: Irv <irv at ELLIJAY.COM>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: August 14, 1998 12:38 AM
Subject: WinHelp Help Please
>Has _anyone_ been able to get WinHelp to work?
>I've tried all sorts of ways, no errors, but nothing ever happens.
>
>-- WinHelp commands:
>constant HELP_CONTEXT = #0001,
> HELP_QUIT = #0002,
> HELP_INDEX = #0003 -- etc
>
>atom user32, winhelp
>
>user32 = open_dll("user32.dll")
>if user32 = 0 then
> puts(1,"Error opening user32")
> abort(1)
>end if
>winhelp = define_c_proc(user32,"WinHelpA",{C_INT,C_POINTER,C_INT,C_INT})
>if winhelp = -1 then
> puts(1,"Error finding WinHelp")
> abort(2)
>end if
>
>global procedure GetHelp(atom whandle, sequence filename, atom command,
>atom data)
>atom pStr
> pStr = allocate_string(filename)
> c_proc(winhelp,{whandle, pStr, command, data})
> free(pStr)
>end procedure
>
>GetHelp(Win,"CALC.HLP",HELP_INDEX,0) -- does nothing when called like
>this
>
>I also tried it as define_c_func, and c_func, with the same zero
>results.
>What am I doing wrong?
>
>TIA
>
>Irv
>
3. Re: WinHelp Help Please
Nate Brooman wrote:
>
> Yes, acually I have got it to work, with Liberty BASIC and Euphoria. You
> have to search your system to find the "area" which calls WinHelp. I don't
> have any source code to it, because I don't use WinHelp. Goto
> http://world.std.com/~carlg/ and download Liberty BASIC and look at the
> examples "calldll*.bas". Shouldn't be hard to port the code to Euphoria.
>
Thanks, Nate!
This helped a lot: I translated the Liberty Basic code to Euphoria, and
can now call the WinHelp engine. click on a help file, and get help.
I next have to work out haow to send messages to the help window
regarding context, etc.
By the way, whoever writes the Euphoria Windows IDE and wrapper could
learn a lot from Liberty - it's really clear and simple.
Here's what I've got so far:
------winhelp.e------
include dll.e
include machine.e
include misc.e
atom winexec,user32,kernel32
integer winhlp_id
if platform() = WIN32 then
user32 = open_dll("user32.dll")
if user32 = 0 then
puts(1,"Error opening user32.dll\n")
abort(1)
end if
kernel32 = open_dll("kernel32.dll")
winexec = define_c_func(kernel32,"WinExec",{C_INT,C_INT},C_INT)
if winexec = -1 then
puts(1,"Error registering WinExec\n")
abort(2)
end if
winhlp_id =
if winhlp_id = -1 then
puts(2, "Error registering WinHelpA\n")
abort(1)
end if
end if
global procedure GetHelp(atom hwnd, -- handle of owner window
sequence FileName, --help file
atom command, -- type of help needed
atom data) -- value related to type of command
atom pStr, start
pStr = allocate_string("WinHelp") -- (-x runs it in the background)
start = c_func(winexec,{pStr,0}) -- run WinHelp
-- how to pass messages to the help engine ??
free(pStr)
end procedure
Regards,
Irv