Click here to Skip to main content
15,897,187 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Exception while using CComPtr Pin
Roger Stoltz7-Apr-09 4:16
Roger Stoltz7-Apr-09 4:16 
AnswerRe: Exception while using CComPtr Pin
Stuart Dootson7-Apr-09 8:08
professionalStuart Dootson7-Apr-09 8:08 
Questionerror C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
soongez7-Apr-09 4:00
soongez7-Apr-09 4:00 
AnswerRe: error C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
Cedric Moonen7-Apr-09 4:19
Cedric Moonen7-Apr-09 4:19 
AnswerRe: error C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
Roger Stoltz7-Apr-09 4:25
Roger Stoltz7-Apr-09 4:25 
GeneralRe: error C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
soongez7-Apr-09 4:58
soongez7-Apr-09 4:58 
GeneralRe: error C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
Roger Stoltz7-Apr-09 5:21
Roger Stoltz7-Apr-09 5:21 
GeneralRe: error C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
soongez7-Apr-09 5:39
soongez7-Apr-09 5:39 
I think I've solved the issue by using the code suggested in the Visual Studio help, and what Roger has said is right.

CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->GetMainWnd();

// Get the active MDI child window.
CMDIChildWnd *pChild = (CMDIChildWnd*)pFrame->GetActiveFrame();

// or CMDIChildWnd *pChild = pFrame->MDIGetActive();

// Get the active view attached to the active MDI child window.
CUCPView *pView = (CUCPView*)pChild->GetActiveView();


then,
pView->UpdateOutputs();


but I had all these strange issues when I tried to add in the first set of code to different parts of the program, saying can't find GetActiveFrame and GetActiveView, even tho I could right click and go to definition. So I added that code all within the same function as where "pView->UpdateOutputs();" was located. Also I couldn't add a declaration "CUCPView *pView" to the SetOutputDlg.h file because when I tried to #include "CUCPView.h" it would come up with lots of errors.

doesn't sound very neat, but works. I came from java and now learning C++ and pointers and such are still giving me troubles.
AnswerRe: error C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
Roger Stoltz7-Apr-09 6:06
Roger Stoltz7-Apr-09 6:06 
GeneralRe: error C2227: left of '->arr' must point to class/struct/union/generic type, but works in Pin
soongez7-Apr-09 6:34
soongez7-Apr-09 6:34 
Questionondraw Pin
p_19607-Apr-09 3:24
p_19607-Apr-09 3:24 
QuestionRe: ondraw Pin
David Crow7-Apr-09 3:28
David Crow7-Apr-09 3:28 
AnswerWelcome in the CP's Members Memorable Quotes! Pin
CPallini7-Apr-09 7:08
mveCPallini7-Apr-09 7:08 
AnswerRe: ondraw Pin
Alan Balkany7-Apr-09 3:59
Alan Balkany7-Apr-09 3:59 
QuestionBegin C++ Pin
yesu prakash7-Apr-09 2:49
yesu prakash7-Apr-09 2:49 
QuestionRe: Begin C++ Pin
David Crow7-Apr-09 3:03
David Crow7-Apr-09 3:03 
AnswerRe: Begin C++ Pin
yesu prakash7-Apr-09 3:08
yesu prakash7-Apr-09 3:08 
GeneralRe: Begin C++ Pin
David Crow7-Apr-09 3:13
David Crow7-Apr-09 3:13 
Questionauto_ptr Pin
sashoalm7-Apr-09 2:45
sashoalm7-Apr-09 2:45 
AnswerRe: auto_ptr Pin
Sarath C7-Apr-09 3:43
Sarath C7-Apr-09 3:43 
GeneralRe: auto_ptr Pin
sashoalm7-Apr-09 4:22
sashoalm7-Apr-09 4:22 
QuestionMFC in VS2003 Pin
p_19607-Apr-09 0:55
p_19607-Apr-09 0:55 
AnswerRe: MFC in VS2003 Pin
Rajesh R Subramanian7-Apr-09 1:08
professionalRajesh R Subramanian7-Apr-09 1:08 
AnswerRe: MFC in VS2003 Pin
Stuart Dootson7-Apr-09 1:14
professionalStuart Dootson7-Apr-09 1:14 
GeneralRe: MFC in VS2003 Pin
Rajesh R Subramanian7-Apr-09 1:26
professionalRajesh R Subramanian7-Apr-09 1:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.