Link to home
Start Free TrialLog in
Avatar of marcomania
marcomania

asked on

XP-Crash during call of .ExecWB

Hi everybody,

i have the problem that my WinXP crashs(no bluscreen etc. its like pulling the plug) if i call
Call BrowserToPrint.Navigate(str_Time_HTML) 'this part works
BrowserToPrint.ExecWB(OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT)
in my VisualBasic 5.0 program.

Sometimes XP crashs during loading of the preview window, sometimes after pressing the print button.

I also tried the other options:
Call BrowserToPrint.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER)
Call BrowserToPrint.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER)

but it doesn't work. Has somebody an idea why XP can crash during this operation?









Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

What is in BrowserToPrint?  I Googled it and found absolutely nothing so it must be a sub or function in one of your modules.
BrowserToPrint s the webbrowser object name
Sorry, stupid comment by me.  Looks like BrowserToPrint is the name of your WebBrowser Control. Duh....
Try creating a new Project with just a WebBrowser control and a CommandButton.

Paste the following code and hit the button.  Does it crash?

' -----------Begin Code
Private Sub Command1_Click()
    WebBrowser1.ExecWB OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT
End Sub

Private Sub Form_Load()
    WebBrowser1.Navigate "http://www.google.com"
End Sub
Avatar of marcomania
marcomania

ASKER

Hi,

i tried the simple version, it works perfect (without a crash) :-(

ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
After testing and testing and testing,
i found out that it must be a problem with my settings

because I tried to print directly with internet explorer ==> crash
i tried it from other computers everything works.

so I make a basic installation with my pc and then we will see

thx for your help

problem is solved,

we found out, that the reason for the xp-crash was a old printer-driver
after installing the new one, everything works perfect.
Thanx for the update!