Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RUN A HTML APPLICATION FROM A PB MENU

Status
Not open for further replies.

thebull1

Programmer
Oct 24, 2001
68
Hi All?
I have a HTML Help application that I want to run from PowerBuilder 6.5 (a bit archaic I admit).
The run command works well for other applications like winword, excel, notepad, etc, but will not open my HHT.HTML file using Explorer.
Any ideas please?
 
I don't remember if this was available in 6.5 (it was in 7.0) but the following should work:

Code:
integer li_rc
inet lcx_key
string ls_filename
li_rc = getcontextservice('Internet',lcx_key)
If (li_rc <> 1) THEN
	messagebox('Clicked','getcontextservice failed')
ELSE
        ls_filename = "c:\whatever.html"
	lcx_key.hyperlinktourl(ls_filename)
END IF
Matt

"Nature forges everything on the anvil of time
 
That works Matt.. Thanks a lot.
The only problem is that absolute path "c:\whatever.html".
Is there a way Ican pick my current working Directory. I would like to put the help files inside the application directory and reference from there. This could be in any directory depending on where the user instals his application.
The command GetCurrentDirectory( ) is not supported by PB6.5.
How do I go round that?
 
Try this API function:

Code:
 GetCurrentDirectoryA( )
This function returns the current working directory into a string by reference.  Be sure to allocate enough space for the string or you'll get a GPF when you exit PowerBuilder.  There is no PowerBuilder equivalent.

Global External Function:
FUNCTION ulong GetCurrentDirectoryA(ulong BufferLen, ref string currentdir) LIBRARY "Kernel32.dll"

Script:
string ls_curdir
ulong l_buf
l_buf = 100
ls_curdir = space(l_buf)
GetCurrentDirectoryA(l_buf, ls_curdir)
MessageBox("Current Directory:", ls_curdir)

Matt

"Nature forges everything on the anvil of time
 
WORKS LIKE MAGIC...

THANKS A LOT MATT!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top