Solved

DataModule and Exception 'Cannot Focalize invisible Windows'

Posted on 1997-06-23
7
246 Views
Last Modified: 2010-04-04
In Delphi 2 i use the DataModule.
 In my tables i have fields which require value so i don't
 need to write a control and exception code to test if
 a value is present. it's "automatic" !!!
But when a valu miss i have this exception message 'cannot focalize invisible windows'
(it is a translation the message is in French Langage)

Hello... I Try your solutions but the exception event seemed raised BEFORE the OnValidate Event
(I Try to put a break at the top of this procedure with the key F5 but the
exception event raised before this.
0
Comment
Question by:F268
  • 3
  • 2
  • 2
7 Comments
 
LVL 2

Expert Comment

by:icampbe1
ID: 1337673
The existing event handler is not doing what you want.  You do not need to write a control to  solve this.  Just supply an OnValidate proc for the field.  It doesn't have to do much... Put up a dialog box maybe, set a default value, or whatever.   OR!!  Trap the execption  (whatever one gets raised)  TRY ... EXCEPT ON Exception DO BEGIN Showmessage('Field missing'); {do whatever} END; END;

0
 

Author Comment

by:F268
ID: 1337674
Edited text of question
0
 

Author Comment

by:F268
ID: 1337675
Hello iCampbe1. I try your solutions and i put a break
(with the key F5) but the exception event seemed arrived BEFORE
the OnValidate Procedure.....


0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 2

Expert Comment

by:icampbe1
ID: 1337676
You must first of all determine exactly where the exception is being raised.  Use TRY... EXCEPT and increase the scope of this TRY EXCEPT until you have captured the exception.  Once you have determined this, then you know what problem you are fixing.
0
 
LVL 1

Accepted Solution

by:
Gabor earned 50 total points
ID: 1337677
I think the editing form is closed before calling the table post method.
You have to call this method directly from your editing form before it is closed, before the form's controls become invisible.

If it doesn't work write down the situation more detailed, maybe I can help you.

0
 

Author Comment

by:F268
ID: 1337678
Sorry but with the DataModule i don't closed the form. it's the special form of Delphi 2 where you can put all the VCL which are non visual object for user (table, datasource,...) and this special 'form' don't have close evenement.

0
 
LVL 1

Expert Comment

by:Gabor
ID: 1337679
It would be good to describe the flow of your task, because I tought that there is a Form with controls to edit the fields of the table.

So?
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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