Devex gives an AV

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33750
    Teasy
    Participant

    Hi,

    I was trying the Devex directive for AC 6.65 and DevEx 6.50.
    All works well, except if you shut down the application on the first form shown.

    I attached a sample project to show.

    Enable the Devex directive – rebuild the AC package(s)
    Run the application and press 'Cancel' –> that results in a AV

    Run the application and press 'OK' –> other form is shown –> close form –> everything is OK

    Checking the stack indicates that the app is breaking his neck on a function cxLookAndFeelPainters.

    Hope you can figure out wat is wrong.

    #42523
    Support
    Keymaster

    Thank you for the demo, I'll check it soon.

    #42595
    Teasy
    Participant

    Any luck?

    #42632
    Support
    Keymaster

    Hello.
    I haven't TCQLabel and TCQBitBtn controls, so, they were changed to standard TLabel and TBitBtn.
    Your problem occurs because this code in the project source is not good :

    CODE
      bCanStart := True;

      Application.Initialize;
      Application.MainFormOnTaskbar := True;

      Application.CreateForm(TDataModule3, DataModule3);

      Form1 := TForm1.Create(Application);
      if Form1.ShowModal <> mrOK then
        bCanStart := False;

      if not bCanStart then
      begin
        Form1.Free;
        Application.Terminate;
        Exit;
      end;

      Application.CreateForm(TForm2, Form2);
      Application.Run;

    You have memory leaks there, and these leaks are reason of the problem.
    Problem will be solved if you will use a code like this :

    CODE
      Application.Initialize;
      Application.MainFormOnTaskbar := True;

      Application.CreateForm(TDataModule3, DataModule3);

      Form1 := TForm1.Create(Application);

      bCanStart := Form1.ShowModal = mrOK;

      if bCanStart then Application.CreateForm(TForm2, Form2);
      Application.Run;

    #42691
    Teasy
    Participant

    Hi Serge,

    Thanks for the solution.
    Sorry for the inconvenience with my CQLabel en ditto button

    Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.