Page 1 of 1

Connection inside dll

Posted: Mon 04 Feb 2013 18:01
by wyatt
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

Re: Connection inside dll

Posted: Wed 06 Feb 2013 09:34
by DemetrionQ
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.

Re: Connection inside dll

Posted: Wed 06 Feb 2013 12:07
by wyatt
Hi,
Thank You for information. I've checked outside IDE and works perfectly :)