Microsoft
Software
Hardware
Network
Question : Problem calling 2 forms in the same DLL
Hello!
In a DLL i have a form, where i can navigate in a specific folder of my system...
Ok, think that, a .exe call this DLL and Load it...
The form Appear, ok
Now clicking in the same button, the Form will appear again, but, PAM! ERROR! haha
What's happening is, when i do something in the first form, the same thing happen in the second instance of the form, but why?
And the error since, seems the same things is being used by both proccess
example, a TList create in the first instance is being used in the second instance of the form too, and PAM error!
In DLL i'm calling something like
procedure CalltheForm; StdCall;
begin
frmName := TFrmName.Create(Nil);
frmName.Show;
end;
Making some tests, i saw that, when i take some action in the first instance of the form, example, clicking in a button to navigate back, the same action happen in the second instance of the form
how to prevent it? I never got this problem very strange oO
Some idea?
Regards,
Carlos
Answer : Problem calling 2 forms in the same DLL
are you using the same form variable ?
or referencing the form variable from within the form code with it's name instead of using self ?
sample:
procedure TfrmName.Button1Click(Send
er: TObject);
begin
frmName.Caption := 'Button 1 clicked';
end;
--> change to
procedure TfrmName.Button1Click(Send
er: TObject);
begin
Self.Caption := 'Button 1 clicked';
end;
Random Solutions
Outlook 2003 Free/Busy
What causes error "0x80070015" when connecting to bluetooth device in window 7?
Security Alert when Opening Outlook
Unix filler
How to remove new line from a string
Computer in VMWare has black screen with _ symbol
interview questions on SSIS
Prevent Deadlock in Database Coldfusion
asp.net: how would you insert the address 'location' into this hyperlink control
phpmailer errorInfo