Article View: borland.public.delphi.winforms.controls.using
Article #516Re: Problems with 2 instances of the same form.
From: Marc Rohloff TeamB
Date: Thu, 19 Aug 2004 12:40
Date: Thu, 19 Aug 2004 12:40
27 lines
1672 bytes
1672 bytes
On Thu, 19 Aug 2004 09:44:00 +0100, Paul wrote:
Since it is a global variable this will obviously happen. You should
use a local variable:
Function TActivityForm.ShowForm : integer;
var lActivityForm : TActivityForm;
begin
Try
lActivityForm := TActivityForm.Create(nil);
With lActivityForm do begin
SetStuff;
ShowModal;
Result := ActivityID
end;
Finally
lActivityForm.Free;
End;
End;
Also you will need to avoid any reference to the global 'ActivityForm'
variable since it may not point to your instance. I would delete this
global variable entirely.
--
Marc Rohloff [TeamB]
marc rohloff at myrealbox dot com
Technical Details
Message-ID:
<1coa99pobvjfa.dlg@marcrohloff.40tude.net>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<41246978@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff29,767fa88ec44a774a X-Google-Attributes: gid1eff29,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Marc Rohloff [TeamB]" <"on request"> Subject: Re: Problems with 2 instances of the same form. Newsgroups: borland.public.delphi.winforms.controls.using User-Agent: 40tude_Dialog/2.0.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: <41246978@newsgroups.borland.com> Date: Thu, 19 Aug 2004 08:40:16 -0400 Message-ID: <1coa99pobvjfa.dlg@marcrohloff.40tude.net> NNTP-Posting-Host: 4.131.33.201 X-Trace: newsgroups.borland.com 1092919178 4.131.33.201 (19 Aug 2004 05:39:38 -0700) Lines: 27 X-Authenticated-User: mrohloff Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail