Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with Data Module

Posted on 1998-09-22
3
Medium Priority
?
202 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

688 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