Solved

Problem with Data Module

Posted on 1998-09-22
3
194 Views
Last Modified: 2010-04-06
D3/NT4.  I have an MDI app.  One form is the login form which sets ups a global login for the app.  This form accepts username/password, etc and will then pass it to a Data Module which has a 3rd party login and session component on it.  My problem is that I can't seem to access the datamodule from the MDI form.  I have added the datamodule to the implementation USES clause.

When I access the datamodule, it's something like this:

datamodule.componentName.variable := value;

This compiles OK, however at runtime, the value of the datamodule is nil.  I don't have a windows handle to access the datamodule components.  How do I get the handle.
I normally would use something like MDIChilren to get the handle for a MDI child window, but this isn't a window, it's a data module.  What do I need to do?
Please be specific...
Thanks
George
0
Comment
Question by:gspears060598
3 Comments
 

Accepted Solution

by:
gdebiasa earned 100 total points
ID: 1340572
Is your datamodule being Auto-Created (under Project Options)? If it's not, that's your problem. Either auto-create it or explicitly create it before you try to use it (using DataModule.Create, for example).

DataModules are essentially just special types of forms, so I suspect that the rules that apply to forms, also apply to DataModules.

Glen
0
 
LVL 1

Expert Comment

by:pjdb
ID: 1340573
In the same way, the data module creation can be too late. I mean the MDI form is created at the begining of the main program (in the dpr file) and during the creation you try to access to the datamodule which is created after that.
I think that you'd better to ask for the username/password in the data module creation so that it will be created before any acess to it.
0
 

Author Comment

by:gspears060598
ID: 1340574
That was it... An easy 100 points <g>

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now