BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using a TDatamodule within a runtime package

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
Bernd Foerder
Guest





PostPosted: Sun Nov 21, 2004 10:41 am    Post subject: Using a TDatamodule within a runtime package Reply with quote



Hi,

I tried to put an TDatamodule in an runtime package, but the problem is that
the global variable:

TDatamodule* Datanodule1;

is not initalized. It is set to 0x0;

Normaly it is initalized by the Application.

My question now is:
How to initialize the Datamodule in the DLLEntryPoint funktion,
so that I can access the content of the Datamodule without getting an
exception.


I have tried to create it with "new TDatamodule(NULL) " , but in this case i
got also an exception when the Datamodule start to create its contents.


Does anybody has an idea how to fix that problem.

Thanks in advance

Bernd





Back to top
Don Locke
Guest





PostPosted: Sun Nov 21, 2004 2:30 pm    Post subject: Re: Using a TDatamodule within a runtime package Reply with quote



Try this:
TestDM = new TTestDM(Application);

Put it into the dll function called by the application. But you would be
better off using a package as if works better with VCL. I started to
convert a large program into dlls but ended up using packages. HTH.
Don
Back to top
Bernd Foerder
Guest





PostPosted: Wed Nov 24, 2004 10:31 am    Post subject: Re: Using a TDatamodule within a runtime package Reply with quote



Hi Don,
thanks a lot for that tip. I tried it and it works well.

During my test, i found out that the Forms:Application variable is
initialized by the package.
Not in the DllEntryPoint, but later it is initalized.

My goal was to encapsulate the DB accesses totaly from the Application and
now it works.

Greetings Bernd

"Don Locke" <dgnospamlocke (AT) comcast (DOT) net> schrieb im Newsbeitrag
news:41a0a68b$1 (AT) newsgroups (DOT) borland.com...
Quote:
Try this:
TestDM = new TTestDM(Application);

Put it into the dll function called by the application. But you would be
better off using a package as if works better with VCL. I started to
convert a large program into dlls but ended up using packages. HTH.
Don



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.