rbajaj
(Rohit Bajaj)
1
Received this error while creating WPF plugin. Traced the error into hydra library source file : UHYVCLCrossPlatformVisualPluginWrapper.pas
Modified the code with additional guard code
procedure THYVCLCrossPlatformVisualPluginWrapper.ShowParented(aParent: TWinControl);
…
if Ctrl <> nil then begin
if Form.CanFocus then
SetFocus(Form.Handle);
**if Form.Focused then**
Form.ActiveControl := Ctrl;
end;
end;
Thanks, logged as bugs://78586
bugs://78586 got closed with status fixed.
rbajaj
(Rohit Bajaj)
4
This bug still remains as your modification assumes that, if
you call SetFocus(Form.Handle) that the form has focus on it!
You have to check to see if the Form is Focused First (using if Form.Focused) before setting the ActiveControl!
This is the modification I made which gets rid of the error
if Ctrl <> nil then
begin
if Form.CanFocus then
begin
SetFocus(Form.Handle);
if Form.Focused then
Form.ActiveControl := Ctrl;
end;
end;
EvgenyK
(Evgeny Karpov)
5
what version of Hydra you are using? the latest RTM ?
rbajaj
(Rohit Bajaj)
6
I believe the source we have is for 5.0.91.1169.
EvgenyK
(Evgeny Karpov)
7
fixed. next beta will contain if Form.Focused then
line