Connection inside dll

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wyatt
Posts: 10
Joined: Fri 17 Oct 2008 10:38

Connection inside dll

Post by wyatt » Mon 04 Feb 2013 18:01

Hi Devart Team.
I've got problem with establishing connection inside dll. I created dll which contains class with MyConnection.

tmp.h

Code: Select all

__declspec(dllexport) class tmpClass {
private:
    TMyConnection *MySQL;
public:
    tmpClass(); // constructor
};
tmp.cpp

Code: Select all

tmpClass::tmpClass() {
   MySQL = new TMyConnection(MySQL);
   MySQL->Database = "test";
   MySQL->Username = "root"
   MySQL->Password = "";
   MySQL->Server = "localhost";
   MySQL->HttpOptions->Url = "http://localhost/tunnel.php";
   MySQL->Options->Protocol = mpHttp;
   MySQL->LoginPrompt = false;
   MySQL->Port = 3306;
   try {
       MySQL->Connect();
   } catch (...) {
   }
}
And now if I'm using mpTCP protocol everything is ok (application connects with MySQL), but when I changed on mpHttp protocol then application crash with error.
Image
Is it possible connect MySQL using mpHttp inside dll?
My environment :
Windows XP SP3
CodeGear C++ Builder 2007 R2
Data Access Components for MySQL 5.90.0.59

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Connection inside dll

Post by DemetrionQ » Wed 06 Feb 2013 09:34

Hello.

This is an error occurring in internal MyDAC objects, that is handled by MyDAC. You can see this exception only when running a project from the IDE, as IDE shows all error messages, even handled ones. If you run the application directly, you won't see the error. This error doesn't mean connection failure.

wyatt
Posts: 10
Joined: Fri 17 Oct 2008 10:38

Re: Connection inside dll

Post by wyatt » Wed 06 Feb 2013 12:07

Hi,
Thank You for information. I've checked outside IDE and works perfectly :)

Post Reply