Alaska Software Inc. - Pop-up window for web-based help from within xBase app????
Username: Password:
AuthorTopic: Pop-up window for web-based help from within xBase app????
GaryPop-up window for web-based help from within xBase app????
on Tue, 25 Nov 2008 15:06:35 -0500
Hello all!
While a user is in our xBase++ app, I would like to open a browser
window and have it display specific help from our web site.  I can
already do this from within our app using the PrinterAPI.LIB and
the WinAPIOpen() function.  This works, but it is crude and opens a
full size browser window.

What I would like to do is open the browser as more of a pop-up
window so it does not cover the xBase++ app in the background.
I can do this with JavaScript using the window.open(); method
(this method allows me to disable the tool bar and specifiy a window
size - good!.)  How can I call a JavaScript method and have it call our web
site with a dynamic URL   OR   are there any solutions like this I can
implement with xBase++?
Thanks is advance!!!
Gary
Andreas Gehrs-Pahl
Re: Pop-up window for web-based help from within xBase app????
on Tue, 25 Nov 2008 17:39:46 -0500
Gary,

>While a user is in our xBase++ app, I would like to open a browser
>window and have it display specific help from our web site. I can
>already do this from within our app using the PrinterAPI.LIB and
>the WinAPIOpen() function. This works, but it is crude and opens a
>full size browser window.

It should be fairly simple to do this with an XbpHTMLViewer object,
but IMNSHO it would make much more sense to compile this web-based
help system to a CHM file, as it would allow context-sensitive help
by simply pressing F1 (or by selecting a Help Menu or Help Button),
and it wouldn't require internet-access.

Anyway, here is a code snippet to show a web page (or virtually any
OLE file) in an IE-window on an XbpDialog inside your program:

oIEV := XbpHTMLViewer():New(oParent, NIL, aPos, aSize)
oIEV:Create() ; oIEV:Show() ; oIEV:Navigate(cURL) ; SetAppFocus(oIEV)

"cURL" can be a web site address or a file name, like a Word document 
or Excel spreadsheet! Using 1.90.331, I have had a lot of problems with 
the above, but with any of the 1.90 SL-1 releases it works quite well.

Hope that helps.

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
GaryRe: Pop-up window for web-based help from within xBase app????
on Wed, 26 Nov 2008 10:27:20 -0500
Andreas,
Thanks for the help! We do have 1.90.331 however I can't find
where to download SL1 from the alaska-software site.  Is it
out yet???
Gary


<Andreas Gehrs-Pahl> wrote in message 
news:1hz35ggrq8d1e.1cdsdz6ce008k.dlg@40tude.net...
> Gary,
>
>>While a user is in our xBase++ app, I would like to open a browser
>>window and have it display specific help from our web site. I can
>>already do this from within our app using the PrinterAPI.LIB and
>>the WinAPIOpen() function. This works, but it is crude and opens a
>>full size browser window.
>
> It should be fairly simple to do this with an XbpHTMLViewer object,
> but IMNSHO it would make much more sense to compile this web-based
> help system to a CHM file, as it would allow context-sensitive help
> by simply pressing F1 (or by selecting a Help Menu or Help Button),
> and it wouldn't require internet-access.
>
> Anyway, here is a code snippet to show a web page (or virtually any
> OLE file) in an IE-window on an XbpDialog inside your program:
>
> oIEV := XbpHTMLViewer():New(oParent, NIL, aPos, aSize)
> oIEV:Create() ; oIEV:Show() ; oIEV:Navigate(cURL) ; SetAppFocus(oIEV)
>
> "cURL" can be a web site address or a file name, like a Word document
> or Excel spreadsheet! Using 1.90.331, I have had a lot of problems with
> the above, but with any of the 1.90 SL-1 releases it works quite well.
>
> Hope that helps.
>
> -- Andreas
>
> ---                                                                      ---
>  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>  415 Gute Street                     or: Andreas@DDPSoftware.com
>  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---
>
James Loughner Re: Pop-up window for web-based help from within xBase app????
on Wed, 26 Nov 2008 10:36:49 -0500
You need to log in to get the download

Jim

Gary wrote:
> Andreas,
> Thanks for the help! We do have 1.90.331 however I can't find
> where to download SL1 from the alaska-software site.  Is it
> out yet???
> Gary
> 
> 
> <Andreas Gehrs-Pahl> wrote in message 
> news:1hz35ggrq8d1e.1cdsdz6ce008k.dlg@40tude.net...
>> Gary,
>>
>>> While a user is in our xBase++ app, I would like to open a browser
>>> window and have it display specific help from our web site. I can
>>> already do this from within our app using the PrinterAPI.LIB and
>>> the WinAPIOpen() function. This works, but it is crude and opens a
>>> full size browser window.
>> It should be fairly simple to do this with an XbpHTMLViewer object,
>> but IMNSHO it would make much more sense to compile this web-based
>> help system to a CHM file, as it would allow context-sensitive help
>> by simply pressing F1 (or by selecting a Help Menu or Help Button),
>> and it wouldn't require internet-access.
>>
>> Anyway, here is a code snippet to show a web page (or virtually any
>> OLE file) in an IE-window on an XbpDialog inside your program:
>>
>> oIEV := XbpHTMLViewer():New(oParent, NIL, aPos, aSize)
>> oIEV:Create() ; oIEV:Show() ; oIEV:Navigate(cURL) ; SetAppFocus(oIEV)
>>
>> "cURL" can be a web site address or a file name, like a Word document
>> or Excel spreadsheet! Using 1.90.331, I have had a lot of problems with
>> the above, but with any of the 1.90 SL-1 releases it works quite well.
>>
>> Hope that helps.
>>
>> -- Andreas
>>
>> ---                                                                      ---
>>  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>>  415 Gute Street                     or: Andreas@DDPSoftware.com
>>  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>>  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
>> ---                                                                      ---
>>
> 
> 
>
GaryRe: Pop-up window for web-based help from within xBase app????
on Tue, 02 Dec 2008 09:35:02 -0500
Andreas,
We can't seen to get this to work. Using the example from the xBase Help.
Do we need SL1 to make it work or should it display w/o SL1.  We get the
dialog window up, but no HTML content.
Thanks,
Gary


<Andreas Gehrs-Pahl> wrote in message 
news:1hz35ggrq8d1e.1cdsdz6ce008k.dlg@40tude.net...
> Gary,
>
>>While a user is in our xBase++ app, I would like to open a browser
>>window and have it display specific help from our web site. I can
>>already do this from within our app using the PrinterAPI.LIB and
>>the WinAPIOpen() function. This works, but it is crude and opens a
>>full size browser window.
>
> It should be fairly simple to do this with an XbpHTMLViewer object,
> but IMNSHO it would make much more sense to compile this web-based
> help system to a CHM file, as it would allow context-sensitive help
> by simply pressing F1 (or by selecting a Help Menu or Help Button),
> and it wouldn't require internet-access.
>
> Anyway, here is a code snippet to show a web page (or virtually any
> OLE file) in an IE-window on an XbpDialog inside your program:
>
> oIEV := XbpHTMLViewer():New(oParent, NIL, aPos, aSize)
> oIEV:Create() ; oIEV:Show() ; oIEV:Navigate(cURL) ; SetAppFocus(oIEV)
>
> "cURL" can be a web site address or a file name, like a Word document
> or Excel spreadsheet! Using 1.90.331, I have had a lot of problems with
> the above, but with any of the 1.90 SL-1 releases it works quite well.
>
> Hope that helps.
>
> -- Andreas
>
> ---                                                                      ---
>  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>  415 Gute Street                     or: Andreas@DDPSoftware.com
>  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---
>
Andreas Gehrs-Pahl
Re: Pop-up window for web-based help from within xBase app????
on Tue, 02 Dec 2008 14:56:51 -0500
Gary,

Add the following to your code:

   oIEV := XbpHTMLViewer():New(oParent, NIL, aPos, aSize)
#if XPPVER < 1900345
   oIEV:UseGuiThread := .f.
#endif
   oIEV:Create() ; oIEV:Show() ; oIEV:Navigate(cURL) ; SetAppFocus(oIEV)

This should fix it (for the most part.)

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
GaryRe: Pop-up window for web-based help from within xBase app????
on Mon, 08 Dec 2008 00:58:33 -0500
Andreas,
That worked - many thanks!!!!! Just one more item.  How can I test too
see if the user is connected to the Internet and able to communicate
via port 80??? I would like to alter the user if they are not connected or
if blocked by a firewall or antivirus software so they know why they
can not view our help.  Thanks again!
Gary



<Andreas Gehrs-Pahl> wrote in message 
news:19kj3u3g3p415$.14oqpc8tlk085$.dlg@40tude.net...
> Gary,
>
> Add the following to your code:
>
>   oIEV := XbpHTMLViewer():New(oParent, NIL, aPos, aSize)
> #if XPPVER < 1900345
>   oIEV:UseGuiThread := .f.
> #endif
>   oIEV:Create() ; oIEV:Show() ; oIEV:Navigate(cURL) ; SetAppFocus(oIEV)
>
> This should fix it (for the most part.)
>
> -- Andreas
>
> ---                                                                      ---
>  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>  415 Gute Street                     or: Andreas@DDPSoftware.com
>  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---
>
Andreas Gehrs-Pahl
Re: Pop-up window for web-based help from within xBase app????
on Wed, 10 Dec 2008 03:48:31 -0500
Gary,

>That worked - many thanks!!!!!

You are welcome!

>Just one more item. How can I test too see if the user is connected to 
>the Internet and able to communicate via port 80??? 

The easiest way is to place a small test file on your website, and use
LoadFromURL() to retrieve it. If that fails, you can alert the user. 
Something like this should work:

Function CheckForWebAccess()
LOCAL cText := LoadFromURL('http://www.YourWebsite.com/Test.File')
return (.not. empty(cText) .and. cText == 'Expected content of Test.File')

You need the ".not. empty(cText)" part because LoadFromURL() will return 
NIL if there is a problem (instead of a string)! But you also need to do 
the comparison, because you might get an error HTML file from a software 
or hardware proxy (firewall, etc.) that blocks (unauthorized) web access 
(of your application or your user) or requires the user to login, first.

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---