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++ / March 2004

Tip: Looking for answers? Try searching our database.

Object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Artek - 25 Mar 2004 08:21 GMT
Hi

Consider the sample .NET 2003 Windows Form application
In winmain we got
Application::Run(new Form1()) instruction which creates the instance (object) of Form1 class.
But how can I use the methods of this object by its name
If I want to use these methods in Form1 class I use "this->" oprerator but what if want to run
them from another class (assuming they are public)?. How can I reference them? By which name
Jacobo Rodriguez - 25 Mar 2004 09:06 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> them from another class (assuming they are public)?. How can I reference them? By which name?
>  
Form1 *form = new Form1();
form->Method1();
form->Method2();
.
.
.
Application::Run(form);

Signature

Jacobo Rodríguez Villar

Proyectos en desarrollo:

http://www.typhoonlabs.com

Artek - 25 Mar 2004 11:01 GMT
That's right but "form" is only visible in winmain function. What if I want to cal
form->Method1() from eg. some differnet class or differnet included cpp file

--
Artur
   
    ----- Jacobo Rodriguez wrote: ----
   
    Artek wrote
    > Hi
    >> Consider the sample .NET 2003 Windows Form application
    > In winmain we got
    > Application::Run(new Form1()) instruction which creates the instance (object) of Form1 class.
    > But how can I use the methods of this object by its name
    > If I want to use these methods in Form1 class I use "this->" oprerator but what if want to run
    > them from another class (assuming they are public)?. How can I reference them? By which name
    >  
    Form1 *form = new Form1()
    form->Method1()
    form->Method2()
    .
    .
    .
    Application::Run(form)
   
    --
    Jacobo Rodríguez Villa
   
    Proyectos en desarrollo
   
    http://www.typhoonlabs.co
AbstractDonut - 26 Mar 2004 03:11 GMT
I'm thinking you have to pass a pointer to where ever you want to use the form at.  Or maybee you could use the scope resolution operatior ::

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



©2009 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.