[WebGadget] Page error causes program error

Everything else that doesn't fall into one of the other PB categories.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

[WebGadget] Page error causes program error

Post 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?
:mrgreen:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [WebGadget] Page error causes program error

Post by ts-soft »

Code: Select all

Define browser.IWebBrowser2
browser = GetWindowLongPtr_(GadgetID(0), #GWL_USERDATA) 
If browser: browser\put_Silent(#True): EndIf 
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [WebGadget] Page error causes program error

Post 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
:mrgreen:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [WebGadget] Page error causes program error

Post by ts-soft »

Sorry, but there is no crashing!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kiffi
Addict
Addict
Posts: 1525
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: [WebGadget] Page error causes program error

Post by Kiffi »

ts-soft wrote:Sorry, but there is no crashing!
Same here. 10 tries, no crash.

Greetings ... Peter
Hygge
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [WebGadget] Page error causes program error

Post 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.
:mrgreen:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [WebGadget] Page error causes program error

Post by ts-soft »

DesktopWidht(0) works as it should on win 8.1.
Your examplecode works also without crash.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [WebGadget] Page error causes program error

Post by es_91 »

Thanks. :)
:mrgreen:
Post Reply