Link to home
Start Free TrialLog in
Avatar of Labib Nassim
Labib Nassim

asked on

"Could not obtain OLE control window handle" under Delphi XE8

I am running Delphi XE8 under Windows 7.

Sometimes, I get the above message when debugging a program in the Delphi debugger. Restarting Delphi does not alwwork and I need to restart computer. I don't know what triggers it.

In the details window below this message, the following is to be found:

[508073F0]{vcl220.bpl  } Vcl.OleCtrls.TOleControl.HookControlWndProc (Line 1489, "Vcl.OleCtrls.pas" + 5) + $18
[50806484]{vcl220.bpl  } Vcl.OleCtrls.TOleControl.CreateWnd (Line 870, "Vcl.OleCtrls.pas" + 8) + $2
[50A715E1]{vclie220.bpl} SHDocVw.TWebBrowser.CreateWnd (Line 2771, "SHDocVw.pas" + 1) + $2
[50686BFA]{vcl220.bpl  } Vcl.Controls.TWinControl.CreateHandle (Line 9574, "Vcl.Controls.pas" + 3) + $4
[50686EC0]{vcl220.bpl  } Vcl.Controls.TWinControl.UpdateShowing (Line 9697, "Vcl.Controls.pas" + 7) + $11
[50686EEE]{vcl220.bpl  } Vcl.Controls.TWinControl.UpdateShowing (Line 9700, "Vcl.Controls.pas" + 10) + $10
[50687068]{vcl220.bpl  } Vcl.Controls.TWinControl.UpdateControlState (Line 9744, "Vcl.Controls.pas" + 21) + $3
[50686206]{vcl220.bpl  } Vcl.Controls.TWinControl.InsertControl (Line 9114, "Vcl.Controls.pas" + 25) + $2
[50681588]{vcl220.bpl  } Vcl.Controls.TControl.SetParent (Line 6040, "Vcl.Controls.pas" + 9) + $4
[5068D099]{vcl220.bpl  } Vcl.Controls.TWinControl.SetParent (Line 13532, "Vcl.Controls.pas" + 5) + $5
[507C18AC]{vcl220.bpl  } Vcl.Forms.TCustomForm.SetParent (Line 4178, "Vcl.Forms.pas" + 12) + $5
[5068900F]{vcl220.bpl  } Vcl.Controls.TWinControl.DoAddDockClient (Line 10802, "Vcl.Controls.pas" + 0) + $3
[50680DD4]{vcl220.bpl  } Vcl.Controls.TControl.Dock (Line 5759, "Vcl.Controls.pas" + 24) + $C
[507C290A]{vcl220.bpl  } Vcl.Forms.TCustomForm.Dock (Line 4759, "Vcl.Forms.pas" + 3) + $4
[5068946D]{vcl220.bpl  } Vcl.Controls.TWinControl.CMDockClient (Line 10989, "Vcl.Controls.pas" + 11) + $13
[5073D983]{vcl220.bpl  } Vcl.ExtCtrls.TCustomPanel.CMDockClient (Line 3397, "Vcl.ExtCtrls.pas" + 37) + $6
[50682FE9]{vcl220.bpl  } Vcl.Controls.TControl.WndProc (Line 7245, "Vcl.Controls.pas" + 91) + $6
[50063B1C]{rtl220.bpl  } System.@FinalizeArray (Line 31645, "System.pas" + 80) + $0
[50063A64]{rtl220.bpl  } System.@FinalizeRecord (Line 31407, "System.pas" + 25) + $0
[50063B64]{rtl220.bpl  } System.@FinalizeArray (Line 31692, "System.pas" + 127) + $0
[501E7AD3]{rtl220.bpl  } System.IniFiles.TStringHash.Find (Line 495, "System.IniFiles.pas" + 17) + $1B
[50687B91]{vcl220.bpl  } Vcl.Controls.TWinControl.WndProc (Line 10079, "Vcl.Controls.pas" + 158) + $6
[50068DEE]{rtl220.bpl  } SysInit.@GetTls (Line 757, "SysInit.pas" + 23) + $0
[5065E00D]{vcl220.bpl  } Vcl.Graphics.TResourceManager.FreeResource (Line 1865, "Vcl.Graphics.pas" + 20) + $D
[50690BC3]{vcl220.bpl  } Vcl.Controls.TDockTree.WndProc (Line 15693, "Vcl.Controls.pas" + 74) + $5
[5065E0BB]{vcl220.bpl  } Vcl.Graphics.TResourceManager.ChangeResource (Line 1900, "Vcl.Graphics.pas" + 14) + $D
[50847877]{vcl220.bpl  } Vcl.CaptionedDockTree.TCaptionedDockTree.WndProc (Line 252, "Vcl.CaptionedDockTree.pas" + 23) + $2
[5069047B]{vcl220.bpl  } Vcl.Controls.TDockTree.WindowProc (Line 15437, "Vcl.Controls.pas" + 1) + $4
[50682C24]{vcl220.bpl  } Vcl.Controls.TControl.Perform (Line 7023, "Vcl.Controls.pas" + 10) + $8
[5068907E]{vcl220.bpl  } Vcl.Controls.TWinControl.DockDrop (Line 10838, "Vcl.Controls.pas" + 5) + $16
[2108C721]{designide220.bpl} IDEDockPanel.TEditorDockPanel.DockDrop (Line 193, "IDEDockPanel.pas" + 17) + $A
[506827DB]{vcl220.bpl  } Vcl.Controls.TControl.ManualDock (Line 6866, "Vcl.Controls.pas" + 50) + $10
[50061961]{rtl220.bpl  } System.@UStrFromPWCharLen (Line 24913, "System.pas" + 28) + $0
[50063030]{rtl220.bpl  } System.@UStrCopy (Line 30098, "System.pas" + 18) + $A
[0042B0A8]{bds.exe     } AppMain.TAppBuilder.DockEditWindow (Line 7144, "AppMain.pas" + 7) + $18
[0041BA13]{bds.exe     } AppMain.TBorlandIDE.DockEditWindow (Line 1495, "AppMain.pas" + 0) + $3
[2064B7A8]{coreide220.bpl} Desktop.LoadDeskState (Line 645, "Desktop.pas" + 52) + $13
[2064EA68]{coreide220.bpl} Desktop.TDesktopState.Load (Line 1754, "Desktop.pas" + 3) + $F
[2064E377]{coreide220.bpl} Desktop.TDesktopStates.LoadDesktop (Line 1585, "Desktop.pas" + 3) + $0
[2064E4D0]{coreide220.bpl} Desktop.TDesktopStates.LoadRuntimeDesktop (Line 1642, "Desktop.pas" + 8) + $7
[2064E69E]{coreide220.bpl} Desktop.TDesktopStates.ProcessCreated (Line 1667, "Desktop.pas" + 2) + $1C
[207AAB38]{coreide220.bpl} DebuggerMgr.TProcessEvent.Send (Line 710, "DebuggerMgr.pas" + 2) + $0
[207AEC61]{coreide220.bpl} DebuggerMgr.TDebuggerMgr.ProcessCreated (Line 2313, "DebuggerMgr.pas" + 9) + $D
[2034FC26]{dbkdebugide220.bpl} Debug.TDebugger.NotifyProcessCreated (Line 11291, "Debug.pas" + 2) + $18
[210B8C25]{designide220.bpl} ToolUtils.ForEach (Line 99, "ToolUtils.pas" + 5) + $F
[2034F052]{dbkdebugide220.bpl} Debug.TDebugger.InitNewProcess (Line 10960, "Debug.pas" + 9) + $22
[20351CE8]{dbkdebugide220.bpl} Debug.TDebugger.DoCreateProcess (Line 11865, "Debug.pas" + 79) + $6
[20351E68]{dbkdebugide220.bpl} Debug.TDebugger.CreateProcess (Line 11886, "Debug.pas" + 6) + $2F
[20352993]{dbkdebugide220.bpl} Debug.TDebugger.Run (Line 12295, "Debug.pas" + 23) + $33
[203535A7]{dbkdebugide220.bpl} Debug.TDebugger.Run (Line 12644, "Debug.pas" + 150) + $4D
[2034D5BE]{dbkdebugide220.bpl} Debug.TDebugger.Run (Line 10271, "Debug.pas" + 0) + $2
[207ADCA1]{coreide220.bpl} DebuggerMgr.TDebuggerMgr.Run (Line 1915, "DebuggerMgr.pas" + 3) + $B
[50172023]{rtl220.bpl  } System.Classes.TBasicAction.Execute (Line 16378, "System.Classes.pas" + 3) + $7
[5066C5DA]{vcl220.bpl  } Vcl.ActnList.TCustomAction.Execute (Line 259, "Vcl.ActnList.pas" + 19) + $35
[50171E7B]{rtl220.bpl  } System.Classes.TBasicActionLink.Execute (Line 16289, "System.Classes.pas" + 2) + $7
[507AF8CB]{vcl220.bpl  } Vcl.Menus.TMenuItem.Click (Line 2521, "Vcl.Menus.pas" + 17) + $7
[507B145F]{vcl220.bpl  } Vcl.Menus.DoClick (Line 3691, "Vcl.Menus.pas" + 41) + $4
[507B154B]{vcl220.bpl  } Vcl.Menus.TMenu.IsShortCut (Line 3744, "Vcl.Menus.pas" + 38) + $6
[00424DFD]{bds.exe     } AppMain.TAppBuilder.FormShortCut (Line 4770, "AppMain.pas" + 2) + $C
[507C6FD4]{vcl220.bpl  } Vcl.Forms.TCustomForm.IsShortCut (Line 7385, "Vcl.Forms.pas" + 2) + $16
[507CB242]{vcl220.bpl  } Vcl.Forms.TApplication.IsShortCut (Line 10289, "Vcl.Forms.pas" + 3) + $27
[507CA818]{vcl220.bpl  } Vcl.Forms.TApplication.WndProc (Line 9929, "Vcl.Forms.pas" + 106) + $6
[50172D80]{rtl220.bpl  } System.Classes.StdWndProc (Line 16882, "System.Classes.pas" + 8) + $0
[50060246]{rtl220.bpl  } System.TMonitor.Exit (Line 17736, "System.pas" + 1) + $2
[5067DD90]{vcl220.bpl  } Vcl.Controls.SendAppMessage (Line 3596, "Vcl.Controls.pas" + 2) + $4
[5068A06D]{vcl220.bpl  } Vcl.Controls.TWinControl.IsMenuKey (Line 11717, "Vcl.Controls.pas" + 16) + $C
[5068A0A5]{vcl220.bpl  } Vcl.Controls.TWinControl.CNKeyDown (Line 11729, "Vcl.Controls.pas" + 5) + $4
[50682FE9]{vcl220.bpl  } Vcl.Controls.TControl.WndProc (Line 7245, "Vcl.Controls.pas" + 91) + $6
[21091CBE]{designide220.bpl} DeskUtil.SetFocusHook (Line 463, "DeskUtil.pas" + 4) + $C
[50687B91]{vcl220.bpl  } Vcl.Controls.TWinControl.WndProc (Line 10079, "Vcl.Controls.pas" + 158) + $6
[507C1F58]{vcl220.bpl  } Vcl.Forms.TCustomForm.WndProc (Line 4427, "Vcl.Forms.pas" + 206) + $5
[52118963]{vcldesigner220.bpl} VCLFormContainer.TControlSizer.ControlWndProc (Line 313, "VCLFormContainer.pas" + 33) + $C
[506871B0]{vcl220.bpl  } Vcl.Controls.TWinControl.MainWndProc (Line 9786, "Vcl.Controls.pas" + 3) + $6
[50172D80]{rtl220.bpl  } System.Classes.StdWndProc (Line 16882, "System.Classes.pas" + 8) + $0
[507CB14C]{vcl220.bpl  } Vcl.Forms.TApplication.IsKeyMsg (Line 10260, "Vcl.Forms.pas" + 25) + $12
[507CB1E6]{vcl220.bpl  } Vcl.Forms.TApplication.IsHintMsg (Line 10281, "Vcl.Forms.pas" + 3) + $2
[507CB3FB]{vcl220.bpl  } Vcl.Forms.TApplication.ProcessMessage (Line 10346, "Vcl.Forms.pas" + 17) + $31
[507CB462]{vcl220.bpl  } Vcl.Forms.TApplication.HandleMessage (Line 10382, "Vcl.Forms.pas" + 1) + $4
[507CB795]{vcl220.bpl  } Vcl.Forms.TApplication.Run (Line 10520, "Vcl.Forms.pas" + 26) + $3
Avatar of Geert G
Geert G
Flag of Belgium image

do you get errors when not debugging ?
SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia 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
Avatar of Labib Nassim
Labib Nassim

ASKER

"do you get errors when not debugging ?"

I don't know. It is difficult to reproduce to order.
you don't know ?
really ?
catching errors should be basic knowledge when programming

the simplest way to catch errors :

try
  // do something
except on E: Exception do 
  WriteToErrorLog(E.Message);
end;

Open in new window


WriteToErrorLog procedure doesn't exist, but it's really simple:

procedure WriteToErrorLog(Msg: string); 
var log: TextFile;
begin
  Assign(log, 'errorlog.txt');
  if FileExists('errorlog.txt') then
    Append(log)
  else
    Rewrite(log);
  WriteLn(log, Msg);
  CloseFile(log);
end;

Open in new window


the TApplication component also has an event to catch any unhandled exception
"do you get errors when not debugging ?"

It has only happened so far in the IDE. Never when running the program. It also happens in a different program that I am also testing.

I added WriteToErrorLog and the problem has stopped. ???
ASKER CERTIFIED SOLUTION
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
Thanks for your help all of you. The Delphi panel to upload an error report appeared twice. Frankly, it seems to lead nowhere.
it doesn't usually :)