Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

global pointer on second form (managed)?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lupina - 10 Jun 2004 09:26 GMT
How to do global pointer , which indicates on the second form ?

If I want e.g. invoke another form I do it like this :

private: System::Void menuItemDlg_Click(System::Object * sender,
System::EventArgs * e)

{

DIALOG1 *myDlg = new DIALOG1;

myDlg->Show();

}

but I want to use "myDlg " in all functions my MainForm. How to declare
myDlg as global pointer?
Michiel - 10 Jun 2004 09:40 GMT
> How to do global pointer , which indicates on the second form ?
>
[quoted text clipped - 13 lines]
> but I want to use "myDlg " in all functions my MainForm. How to declare
> myDlg as global pointer?

Why do you need a global for this ? Why not just make a member ?

Outside any function, but inside the class :
DIALOG1* myDlg;

And then in the MainForm constructor :
myDlg=new DIALOG1();
Lupina - 10 Jun 2004 12:17 GMT
That's right.
Great Thanks :)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.