Solved

Problem with Data Module

Posted on 1998-09-22
3
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month6 days, 22 hours left to enroll

623 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