Subject Re: [IBO] Cursor Unknown
Author Marco Menardi <mmenaz@lycosmail.com>
--- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...> wrote:
> ah ha...
> drop a lookupcombo and exit your applciation while it is still the
drop down
> state... you get a cursor unkown..
> Does this mean that we all have to call closeup methods on any all
> lookupcombos on applicationexit ?
>
> Alan
>

mmm, I had problems like this:
For my forms, I set Action:=caFree to destroy (and not simply hide) them.
In this situation, with dataset in search mode and an item selected
from a IB_ComboBox, when I close the form an error occurs:
"Control 'cbxAccountType' has no parent window"

I sent a patch to Jason long time ago, but was never included. I would
be curios to know if it can solve your problem too, that could be
related. Would you please try this patch and let me know?

My problem seems due to the fact that assigning DataSource := nil in
the IB_ComboBox make the control try to retrieve ItemIndex, that needs
a window handle, but the window is already destroyed...
I've solved this problem with a simple patch, moving in
IB_ComboBox.Destroy the DataSource := nil after that the DataLink is
'defused', i.e.:
(file IBC_ComboBox.IMP)
...
IB_ComboBox.Destroy...
...
// DataSource := nil; // --- old position
with DataLink do
begin
Control := nil;
OnStateChanged := nil;
OnDataChange := nil;
OnUpdateData := nil;
end;
DataSource := nil; // --- new position
...

To me seems not having side effects as far as I've tested it.

Thanks a lot
Marco Menardi