PDA

View Full Version : what to do to get the pointer of CView?



opengllover
03-11-2003, 08:26 PM
I build a project based SDI .In CMyView I use openGL to draw and render my 3D objects,then I create a dialog class based CDialog in order to control openGL of CMyView,but how to get the pointer of CView or CMyView?I use "CView* pView" in dialog class,but I fail to control openGL of CMyView.help me,please...

knackered
03-12-2003, 12:06 AM
Try asking in an MFC forum.

Przemek
03-14-2003, 04:33 AM
Hi!
You have to put the following in the file that contains your CDialog code:

CMyMainFrame* pFrame = (CMyMainFrame*) AfxGetMainWnd();
CMyView* pView = (CMyView*) pFrame->GetActiveView();

Now you have the correct pointer to your view object.

Aditionally you have to include headers of CMyMainFrame and CMyView classes.

[This message has been edited by Przemek (edited 03-14-2003).]

knackered
03-14-2003, 07:17 AM
Oh yeah, and feel free to ask any other MFC questions here.
Now let's talk about Iraq...

Przemek
03-14-2003, 01:22 PM
Yes Knackered, your reply was indeed REALLY informative. <irony on> Keep up the good work! <irony off> Now, what is it that you'd like to learn about Iraq? Maybe I can be of any help, eh?

HS
03-14-2003, 05:13 PM
This is an "advanced OpenGL" forum but then again I guess some guys will ask for a steak in a greengrocery too...

rgpc
03-14-2003, 11:12 PM
Originally posted by Przemek:
Yes Knackered, your reply was indeed REALLY informative.

Actually I thought his reply was better than yours.

It was certainly more suitable given the forum.

Well done knackered... http://www.opengl.org/discussion_boards/ubb/biggrin.gif

<sarcasm on> I really like it when people post OT questions to the Advanced Opengl forum.<sarcasm off>

knackered
03-15-2003, 02:10 AM
Przemek, you have obviously never experienced a proliferation of off-topic posts in a forum before... it completely destroys the forum, and people interested/experienced in the actual topic stop frequenting said forums because they can't see the wood for the trees, so to speak. It happens, believe me.
Think before you speak next time, Przemek.

Przemek
03-15-2003, 04:57 AM
I know what you talk about. But the only thing I wanted to achieve was to help opengllover. I belive my post did it. All next posts are completelly off topic and I can do nothing with it. Anyway in the future I'll be more carefull with answering questions which are off topic, just to avoid this kind of disscusion.
P.S. This was my first post on this forum, and I was happy that I could help somebody.

V-man
03-15-2003, 05:22 AM
In the future go to
microsoft.public.vc.mfc

and try googling for the right forum.
There are 10000 of them.