Re: TDataBase and TQuary



Hi all

Thanks for your feedback, I attentively re-scanned my source and made it
work!

But another problem appeared.

The programm's structure is just terrible (That's not my prog, I just
have to debug it...). It's a COM-object, and its message handler has
lots of IF statements, one per message. And inside each IF block a
TDataModule form is initialized, then message is handled, and the
DataModule destroyed. And it worked before a TDataBase had been
explicitly declared in the DataModule. But after I did it, it started to
give this error (during the Creating of TDataBase): First message is
handled successfully (DataBase created, used, and Destroyed), but the
second one Raises Access violation (read of address 00000012) here:

TDatabase.Create(AOwner: TComponent);
...inherited Create(AOwner);
.....TCustomConnection.Create
.......inherited Create(AOwner);
.........TComponent.Create
...........TComponent.InsertComponent
.............TComponent.ValidateContainer
...............procedure _CallDynaInst; (asm) -- runs fine
...............procedure _GetDynaMethod; (asm) -- runs fine
@@haveVMT:
MOV EDI,[ESI].vmtDynamicTable
TEST EDI,EDI
JE @@parent //JUMPS;
...............TComponent. AComponent.ValidateInsert ()
.................procedure _CallDynaInst; (asm) //in System.pas
.................procedure GetDynaMethod; (asm)
@@haveVMT:
MOV EDI,[ESI].vmtDynamicTable
TEST EDI,EDI
JE @@parent //Doesn't jump
MOVZX ECX,word ptr [EDI] //Does this...
//and gets here (in function _ClassCreate):
@desc:
JMP _HandleAnyException

This looks terrible. No idea what can be wrong.

P.S.: Now I am rewriting it to work the static way...





.



Relevant Pages

  • Re: fork() race in SIGCHLD handler
    ... > It sounds like you should delay setting the handler in the parent till ... > the fork has returned, but that leaves a window in which the child can ... before the parent fork() has returned, so I will definitely miss it. ... Compiler issues will intervene to make that cloudy. ...
    (comp.os.linux.development.system)
  • Re: fork() race in SIGCHLD handler
    ... > It sounds like you should delay setting the handler in the parent till ... > the fork has returned, but that leaves a window in which the child can ... before the parent fork() has returned, so I will definitely miss it. ... Compiler issues will intervene to make that cloudy. ...
    (comp.unix.programmer)
  • logging module and threading
    ... handler). ... j = getjob() ... everything that is logged by the kids is also logged by the parent. ... The docs lead me to expect that I'd see one message from "a" and ...
    (comp.lang.python)
  • Re: Catching button pressed messages
    ... You may want to take a look at a CCheckBox with BS_PUSHLIKE style set. ... the redraw must have been called from a different handler somewhere in the ... BOOL CButtonSubClass::OnWndMsg(UINT message, WPARAM wParam, LPARAM ... // If the state has changed, tell the parent. ...
    (microsoft.public.vc.mfc)
  • Re: Catching button pressed messages
    ... I needed to send a message when the button changes state, so just detecting button down was not enough. ... When found, i compared the state value with the previous value set in OnWndMsg, and if the value is different i send BN_CLICKED to the parent and update the variable. ... BOOL CButtonSubClass::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult) ... In the parent OnButtonClicked handler, i then GetStateand look for BST_PUSHED to determine if the button is up or down. ...
    (microsoft.public.vc.mfc)