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…
Try asking in an MFC forum.
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).]
Oh yeah, and feel free to ask any other MFC questions here.
Now let’s talk about Iraq…
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?
This is an “advanced OpenGL” forum but then again I guess some guys will ask for a steak in a greengrocery too…
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…
<sarcasm on> I really like it when people post OT questions to the Advanced Opengl forum.<sarcasm off>
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.
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.
In the future go to
and try googling for the right forum.
There are 10000 of them.