Page 1 of 1

[WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 5:45 pm
by es_91
Hi. I am hoping to get some answers here.

The WebGadget is a wonderful thing and with the community support of PB you can really turn it into something very useful for your PC application.

However, a page error on some pages causes my WebGadget to shut down the entire program. See:

*** BE CAREFUL! THIS IS NOT A SYSTEM MESSAGE FROM YOUR PC! ***

Image

Translation:

The script of this page contains an error.

Line: 29
Sign: 166
Error: Invalid Argument

Do you want scripts on this page to be furtherly executed?

YES/No

Image

Translation:

PureBasic_Compilation1.exe does not work anymore

CLOSE PROGRAM

What can I do?

Re: [WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 6:05 pm
by ts-soft

Code: Select all

Define browser.IWebBrowser2
browser = GetWindowLongPtr_(GadgetID(0), #GWL_USERDATA) 
If browser: browser\put_Silent(#True): EndIf 

Re: [WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 6:19 pm
by es_91
That removes the page error message but it does not stop the program from crashing. :|

Please try it yourself and tell me if it crashed within three tries at your PC:

Code: Select all

If OpenWindow(0, 0, 0, 1200, 600, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  WebGadget(0, 10, 10, 1180, 580, "http://www.faz.net")
  
  Define browser.IWebBrowser2
  browser = GetWindowLongPtr_(GadgetID(0), #GWL_USERDATA) 
  If browser: browser\put_Silent(#True): EndIf 
  
  Repeat 
  Until WaitWindowEvent() = #PB_Event_CloseWindow 
EndIf

Re: [WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 6:23 pm
by ts-soft
Sorry, but there is no crashing!

Re: [WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 6:30 pm
by Kiffi
ts-soft wrote:Sorry, but there is no crashing!
Same here. 10 tries, no crash.

Greetings ... Peter

Re: [WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 6:37 pm
by es_91
Thank you very much. Since now even chrome crashes on my PC it must be a problem of this. I just tried it on the PC of my neighbour he didn't receive crashes as well.

I'll check my PC.

BTW while trying some fullscreen browsing tools i wrote at the Windows 8.1 PC of my neighbour the screen was way too large in horizontal direction. Could somebody who is using 8.1 please confirm to me that the DesktopWidth() function works correct under 8.1? Maybe this is a bug.

Re: [WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 6:48 pm
by ts-soft
DesktopWidht(0) works as it should on win 8.1.
Your examplecode works also without crash.

Re: [WebGadget] Page error causes program error

Posted: Sun Sep 28, 2014 6:58 pm
by es_91
Thanks. :)