GIDForums

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-May-2006, 04:38
prabhakar157 prabhakar157 is offline
New Member
 
Join Date: May 2006
Posts: 2
prabhakar157 is on a distinguished road
Question

how to access User defined functions of my View class to MainFrm class?


Hi,
how do i access User defined functions of view class to MainFrm class. i tred using

CPP / C++ / C Code:
                  CView* pView = (CView*)AfxGetMainWnd();

using the pointer pView i am able to access CView class funtions but not user defined funtion. how do i do that? Please help me . thanking you in advance.

K.Prabhakar
Last edited by LuciWiz : 11-May-2006 at 04:49. Reason: Please insert your C++ code between [c++] & [/c++] tags
  #2  
Old 17-May-2006, 03:09
imbtf imbtf is offline
Junior Member
 
Join Date: Aug 2004
Posts: 41
imbtf will become famous soon enough

Re: how to access User defined funtions of my View class to MainFrm class?


Not quite sure whether you want to access functions in your view class from your main frame (CFrameWnd derived) or access your view class (CView derived) from your main frame.

Accessing functions in your main frame class (from anywhere in the app)...
CPP / C++ / C Code:
CYourMainFrameClass *pfrm = (CYourMainFrameClass *)AfxGetMainWnd();

Accessing your view from your main frame class..
CPP / C++ / C Code:
SDI app:
CYourViewClass *pview = (CYourViewClass *)GetActiveView( );

MDI app:
CMDIChildWnd *pChild = MDIGetActive();
CVourViewClass *pview = (CYourViewClass *)pChild->GetActiveView();

Try playing around with those functions...
 

Recent GIDBlogNon-US citizens serving in the military by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
a tester class and then some. postage Java Forum 1 06-May-2006 15:48
References to base class to access derived class only members mirizar CPP / C++ Forum 3 03-Dec-2005 20:40
C++ PhoneBook marita CPP / C++ Forum 46 12-Jun-2005 12:10
Error C2146: syntax error : missing ',' before identifier 'C4' mattchew008 CPP / C++ Forum 2 19-Dec-2004 06:06
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 03:38

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:58.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.