Home > Cannot Make > Cannot Make A Visible Window Modal Delphi

Cannot Make A Visible Window Modal Delphi

Then you can be sure in which state the object is and there is no need to use the FreeAndNil. Please allow up to 5 seconds… DDoS protection by CloudFlare Ray ID: 2fe83b9ac23506c4 Inequality caused by float inaccuracy Wrong way on a bike path? If you change a form's FormStyle property from fsMDIChild, it will remain True. Source

The form is shown modally from TForm1.Button1Click, and that suffices. procedure DoCreateLocalForm; var frmLocalSMS: TfrmSMS; begin frmLocalSMS:=TfrmSMS.Create(self); try frmLocalSMS.edCell.text := frmLocalSMS.fixnumber(s); frmLocalSMS.showmodal; finally freeandnil(frmLocalSMS); end; jenny foster Posts: 49 Registered: 12/6/09 Re: Cannot make a visible Window Modal Ari Adrianto MenuExperts Exchange Browse BackBrowse Topics Open Questions Open Projects Solutions Members Articles Videos Courses Contribute Products BackProducts Gigs Live Courses Vendor Services Groups Careers Store Headlines Website Testing Ask Confusion reigns! http://www.codeproject.com/Questions/412005/Access-violation-error-when-for-a-multiforms-appli?arn=0

A modal dialog is used as a temporary Window which pops up and either displays some information or asks for input from the user. Why is this C++ code faster than my hand-written assembly for testing the Collatz conjecture? I've try to search whats wrong, but I can't find it.

This modal form does show another modal form which in turn shows another modal form. Newsgroup reader. Additional Information 1. share|improve this answer edited Jul 31 '14 at 9:00 answered Jul 31 '14 at 8:20 David Heffernan 433k27588955 Yes this works, but it doesn't solve my problem entirely as

What now? Select the OK button 6. Be aware that this does not necessarily mean, that the Form indeed is visible on the screeen, it is sufficient, that the Form is in a state to be visble when her latest blog Call to ShowModal from the constructor The form's OnCreate event is fired during construction.

I don't know why the finally (see below) would fail but it is the only explanation that makes sense to me at this time. Oh, and if it makes a difference, this in Delphi 7. -- Larry Maturo "Larry Maturo" writes Quote I was working with a new form I created, and all was going But if I run my code I get the error "Cannot make a visible window modal" I read that has something to do with the fact that I don't properly close That's the cause of your error message.

Why are LEDs in my home unaffected by voltage drop? http://www.tek-tips.com/viewthread.cfm?qid=1635801 That means when it executes the ShowModal the form has got to be "invisible". Remy That is not true. The app is running at around 25 sites.

Join Now For immediate help use Live now! this contact form Correct answers available: 1. Here's Why Members Love Tek-Tips Forums: Talk To Other Members Notification Of Responses To Questions Favorite Forums One Click Access Keyword Search Of All Posts, And More... hth Bernd Lajos Juhasz Posts: 509 Registered: 3/14/14 Re: Cannot make a visible Window Modal Reply Posted: Sep 12, 2016 7:22 AM in response to: jenny foster

Let's work to help developers, not make them feel stupid. Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI What's going on? have a peek here The thing is that this is the only call to create and show that form so although it is created as a global variable, nothing else touches it That is why

Anyway, then I show, and destroy, the just created form with code like this: try frmSomething.ShowModal; finally frmSomething.Free; end; Now, this code compiles fine, but when running and trying to create Here is the code which identical to that on the create/show of many other forms some of which are created and destroyed far more often in the course of a session In this case the best solution is to use a local object.

Remove those calls.

It is possible to define metric spaces from pure topological concepts without the need to define a distance function? Privacy Policy Site Map Support Terms of Use Please turn JavaScript on and reload the page. hth Bernd jenny foster Posts: 49 Registered: 12/6/09 Re: Cannot make a visible Window Modal Reply Posted: Sep 12, 2016 12:45 AM in response to: Bernd Maierhofer At the end of this procedure you do a FreeAndNil, so you really want to get rid of the form.

Each of these buttons fires the creation of a form. U have set the visible property of the Form to true somewhere i think. Join them; it only takes a minute: Sign up Delphi rebuild modal form at runtime up vote 0 down vote favorite For example I created a small project as for you http://dekovsoft.com/cannot-make/cannot-make-a-visible-window-modal-delphi-2010.html Set the form visible to false and it works, no more error message.

I broke on the ShowModal line in the dubgger, and checked the Visible attribute of the form I had just created., and Visible was set to false. begin CancelDrag; if Visible or not Enabled or (fsModal in FFormState) or (FormStyle = fsMDIChild) then raise EInvalidOperation.Create(SCannotShowModal); // <-- here ... Creating forms dynamically is recommended for forms which may not be opened every time an application is instantiated (such as an About Box). I've got a ModalForm that has some buttons on it created at runtime, but when the user presses a " special button" I want all the buttons from the form to

Add code patterned after the following to the event of your choice (replace AboutBox with the form's instance variable name and TAboutBox with the form's class name): procedure TForm1.AboutBoxClick(Sender: Tobject); begin Quick Fix 1. I have this problem frequently in several programs. If so that is the reason for the issue.

Then the user doesn't have to close it in order to continue her/his work. This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL) Top Experts Last 24hrsThis month John Simmons / outlaw programmer 194 The code: Note that ResultForm may be declared as an global variable of TResultForm or as a local variable. jenny foster Posts: 49 Registered: 12/6/09 Re: Cannot make a visible Window Modal Reply Posted: Sep 14, 2016 12:21 AM in response to: Lajos Juhasz Thanks again

Code for that works, no problems.