If you have used twebbrowser, please come in and ask for help in VCL Component Development and Application
Http://www.delphi2007.net/DelphiVCL/html/delphi_20061222111048196.html
Using twebbrowser as a browser, two webpage files on the local machine are called.
The webpage contains a large number of javescrip scripts,
Three errors occur during the round-trip switch. These three errors are not frequent, but there are always,
One is mshtml. DLL exception
The second is to bring up a dialog box titled "real-time debugging"
"Select a debugger" at the top"
The following is a list box titled "Possible Debugger"
The list box contains a new instance Mircosoft Script Editor"
Below is a check box that sets the current debugger as the default debugger, and at the bottom of it is whether you want to debug with the selected debugger and then click
Third, a dialog box appears. In English, it tells me that I am in the debugging status.
The first problem is that it will appear on all machines during testing.
The second and third problems do not appear on some machines,
When the third problem occurs, it will be closed directly. Program
Development Environment D7 XP
The web page commit crip and mp7 are generated by the tool software.
Expert Solution
Watching...
// Have you initialized Ole?
// All pass
Uses ActiveX;
//...
Initialization
Oleinitialize (NiL );
Finalization
Oleuninitialize;
End.
Http://support.microsoft.com/default.aspx/kb/261003
Accompanied by shuiqing and Jiang Sheng, my other problems are solved by your reply, so I thought about you.
I will try it first, but I don't think I have found any ideas after that page. Can you give me more details?
Self-built
Webbrowser. Silent: = true?
Brother cutting has arrived. He hasn't seen xiaohe yet.
This is not a script running error,
Up
Try again to help you score points.
Again, points are added
You have not seen your webpage script
How do you call it for debugging?
At least you need to provide a debugging environment
The problem has not been solved, but it has been two days. I decided to close the post. Thank you for your support.
I will post another post for help,
Brother Shui
My Code Yes
I have a unit that defines a class. This class reads parameters from the database, generates instances, and then generates buttons on the interface.
Each button corresponds to an instance of this class
Click a button to open the corresponding webpage. These webpages are all local and are mp7 courseware generated by the software.
Including videos and ppt files, and the JavaScript scripts on the webpage are responsible for playing and synchronizing videos and ppt files,
The scripts on the webpage are generated by the software, and it is no problem to play one independently.
The problem is that when I keep pressing the button, that is, after I open a webpage, I immediately open another webpage.
I think webbrowser has transferred a new webpage, but the script in the original webpage has not been released clean or is still running, causing a conflict, so this problem occurs.
The main code is as follows,
Unit define;
//
Tpowerctl = Class (tobject)
Private
But: Boolean;
Fobj: tcontrol;
Fctlinfo: tctlfieldinfo;
Oldx: integer;
Oldy: integer;
Procedure objclick (Sender: tobject );
Procedure objenter (Sender: tobject );
Procedure tpowerctl. objclick (Sender: tobject );
VaR
I: integer;
DOC: ihtmldocument2;
// Temp: integer;
Begin
// Temp: = 0;
For I: = 0 to tcontrol (sender). Parent. ControlCount-1 do
Begin
If tcontrol (sender). Parent. controls [I]). Tag = 9999 then // tag of the webpage Control
Begin
While twebbrowser (tcontrol (sender). Parent. controls [I]). readystate <> 4 do
Application. processmessages; // execute after completion
Twebbrowser (tcontrol (sender). Parent. controls [I]). Stop;
DOC: Maid (FIG;
Doc. close;
Doc. Clear;
Twebbrowser (tcontrol (sender). Parent. controls [I]). navigate (mainpath + self. fctlinfo. findexpage); // call the corresponding webpage
Doc. _ release;
End;
End;
End;
The unit is called by the main form,
The ole control is initialized in the initialization event of this unit. // I have doubts about the initialization.
// Whether the Web is fixed and should be written in the prj initialization event
// Or the initialization event of the main form Unit
If you have any solutions, please go to the new post and reply to them. If you have any solutions, you must score them again. Thank you.