Problem with AssignConnection TMyConnection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
maciejmt
Posts: 27
Joined: Sun 25 Apr 2010 14:14

Problem with AssignConnection TMyConnection

Post by maciejmt » Sun 29 Jul 2012 18:45

Inside in DLL create new instance of TMyConnection.
By procedure pass instance of TMyConnection from main application.
When exit application, then raise Access Violation of memory error

DLL

Code: Select all

library Project2;


uses
  MyAccess,
  Windows,
  System.SysUtils,
  System.Classes;

var
  Conn: TMyConnection;

{$R *.res}

procedure LS_REP_DB(Connection: TMyConnection); stdcall;
begin
  Conn.AssignConnect(Connection);
end;

procedure Destroy(Reason: Integer);
begin
 if Reason = DLL_PROCESS_DETACH then
  Conn.Free;
end;

exports
  LS_REP_DB;

begin
  Conn := TMyConnection.Create(nil);
  DLLProc := @Destroy;
end.
APP

Code: Select all

type
  TForm2 = class(TForm)
    Button1: TButton;
    MyConnection1: TMyConnection;
    procedure Button1Click(Sender: TObject);
  private
  public
  end;

  procedure LS_REP_DB(Connection: TMyConnection);
    stdcall external 'Project2.dll' name 'LS_REP_DB';

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin
  LS_REP_DB(MyConnection1);
end;
Delphi XE2 ; mydac71d16std
Example src: http://encodable.com/cgi-bin/filechucke ... ection.zip

AndreyZ

Re: Problem with AssignConnection TMyConnection

Post by AndreyZ » Mon 30 Jul 2012 07:31

Hello,

Thank you for the information. We reproduced the problem and the investigation is in progress. We will notify you when we have any results.

AndreyZ

Re: Problem with AssignConnection TMyConnection

Post by AndreyZ » Thu 02 Aug 2012 12:23

We have fixed this problem. This fix will be included in the next MyDAC build.

maciejmt
Posts: 27
Joined: Sun 25 Apr 2010 14:14

Re: Problem with AssignConnection TMyConnection

Post by maciejmt » Thu 02 Aug 2012 16:07

Thanks

AndreyZ

Re: Problem with AssignConnection TMyConnection

Post by AndreyZ » Thu 02 Aug 2012 16:14

Feel free to contact us if you have any further questions about MyDAC.

maciejmt
Posts: 27
Joined: Sun 25 Apr 2010 14:14

Re: Problem with AssignConnection TMyConnection

Post by maciejmt » Wed 08 Aug 2012 21:46

Hi AndreyZ

My free updates expired on version 7.1.4.
Will it be possible to patch this version in this case ?

AndreyZ

Re: Problem with AssignConnection TMyConnection

Post by AndreyZ » Thu 09 Aug 2012 08:38

In this case, to obtain the fix, you will need to renew your subscription. After subscription renewal you will be able to download the latest MyDAC version with this fix from Registered Users' Area.

mparak
Posts: 1
Joined: Sat 18 Aug 2012 21:14

Re: Problem with AssignConnection TMyConnection

Post by mparak » Sat 18 Aug 2012 21:23

Hi,
We are very keen on the resolution of this issue as we need to send the TMyConnection from our application to the dlls we created.
I realize that the matter has been resolved, but would love to know which version to use if we want to avoid this bug.

Please advise.

Regards
Mo
South Africa.

AndreyZ

Re: Problem with AssignConnection TMyConnection

Post by AndreyZ » Mon 20 Aug 2012 05:18

We haven't released MyDAC since we fixed this problem. This fix will be included in the next MyDAC build.

robo
Posts: 2
Joined: Thu 20 Sep 2012 15:06

Re: Problem with AssignConnection TMyConnection

Post by robo » Thu 20 Sep 2012 15:12

Hi,

I see MyDAC version 7.5 is now available for download.

Is this problem of passing a connection to a dll resolved in the new version?

If not, can you please recommend alternate methods to do so, especially on Delphi 7?

Thanks

AndreyZ

Re: Problem with AssignConnection TMyConnection

Post by AndreyZ » Fri 21 Sep 2012 08:37

Yes, this problem is solved in MyDAC 7.5.9.

robo
Posts: 2
Joined: Thu 20 Sep 2012 15:06

Re: Problem with AssignConnection TMyConnection

Post by robo » Tue 25 Sep 2012 08:11

Thanks.

Will upgrade and try it out.

Post Reply