Click here to Skip to main content
15,917,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow can i use mfc Pin
hafiz m abu bakar siddique29-Oct-07 19:15
hafiz m abu bakar siddique29-Oct-07 19:15 
AnswerRe: how can i use mfc Pin
CodingLover29-Oct-07 19:42
CodingLover29-Oct-07 19:42 
GeneralRe: how can i use mfc Pin
Nelek30-Oct-07 1:47
protectorNelek30-Oct-07 1:47 
GeneralRe: how can i use mfc Pin
CodingLover30-Oct-07 19:45
CodingLover30-Oct-07 19:45 
AnswerRe: how can i use mfc Pin
ThatsAlok29-Oct-07 19:44
ThatsAlok29-Oct-07 19:44 
QuestionRe: how can i use mfc Pin
Hamid_RT29-Oct-07 20:04
Hamid_RT29-Oct-07 20:04 
QuestionRe: how can i use mfc Pin
David Crow30-Oct-07 3:39
David Crow30-Oct-07 3:39 
QuestionHow to understand CCeateContext members completely? Pin
SAMZC29-Oct-07 19:11
SAMZC29-Oct-07 19:11 
The following is from MSDN...
//
m_pNewViewClass
CRuntimeClass of the new view to create.
m_pCurrentDoc
The existing document to be associated with the new view.
m_pNewDocTemplate
The document template associated with the creation of a new MDI frame window.
m_pLastView
The original view upon which additional views are modeled, as in the creation of a splitter window's views or the creation of a second view on a document.
m_pCurrentFrame
The frame window upon which additional frame windows are modeled, as in the creation of a second frame window on a document.
//
Here m_pNewViewClass and m_pCurrentDoc is easy to understand.m_pNewViewClass specifies the view class to create a new view. And m_pCurrentDoc gives the document which the new view will attach with.

My question is about the other members.
1/ m_pNewDocTemplate -- how to understand its function and role to create a view?
2/ m_pCurrentFrame -- ?
3/ m_pLastView -- ?

In what situation, the members would be used and for what purpose?

From my side, for example I wanna add another view for a document after default view/doc created by m_pDocTemplate->OpenDocumentFile(NULL/strFile) in an MDI app.
//Demo code
CMainFrame::CreateNewView()//
{
CMyHtmlChildFrame* pHtmlChild=new CMyHtmlChildFrame();//use CRuntimeClass* is also OK

CMDIDemoDoc* pDoc=(CMDIDemoDoc*)(MDIGetActive()- >GetActiveDocument());
ASSERT_VALID(pDoc);

CMultiDocTemplate* pTemplate=(CMultiDocTemplate*)(pDoc- >GetDocTemplate());
ASSERT_VALID(pTemplate);

CCreateContext context;
context.m_pCurrentDoc=pDoc;// use existing document
context.m_pCurrentFrame=pHtmlChild;// new child frame to be upon ??
context.m_pNewViewClass=RUNTIME_CLASS(CMyHtmlView);// new view to be created
context.m_pNewDocTemplate=pTemplate;// use existing document Template??
context.m_pLastView=NULL;// no

if (!pHtmlChild- >LoadFrame(IDI_ICON1,WS_OVERLAPPEDWINDOW ¦FWS_ADDTOTITLE,this,&context))
{
TRACE0("Warning: Couldn 't load frame window!\n");
return -1;
}
//pHtmlChild- >ShowWindow(SW_SHOWMAXIMIZED);
pHtmlChild- >InitialUpdateFrame(pDoc,TRUE);
//pTemplate- >InitialUpdateFrame(pHtmlChild,pDoc,TRUE);

//it worked!
return 0;
}
//
context.m_pCurrentFrame=pHtmlChild;
context.m_pNewDocTemplate=pTemplate;
//
here I can't understand its function in spite that I write it out.

Apprecaited for your kind explanation...

Sam
AnswerRe: How to understand CCeateContext members completely? Pin
SAMZC30-Oct-07 16:13
SAMZC30-Oct-07 16:13 
QuestionProblem with GetBitmapBits() in Win32 Pin
ashishbhatt29-Oct-07 18:49
ashishbhatt29-Oct-07 18:49 
AnswerRe: Problem with GetBitmapBits() in Win32 Pin
Naveen29-Oct-07 18:52
Naveen29-Oct-07 18:52 
GeneralRe: Problem with GetBitmapBits() in Win32 Pin
ashishbhatt29-Oct-07 19:01
ashishbhatt29-Oct-07 19:01 
GeneralRe: Problem with GetBitmapBits() in Win32 Pin
Naveen29-Oct-07 19:15
Naveen29-Oct-07 19:15 
GeneralRe: Problem with GetBitmapBits() in Win32 Pin
ashishbhatt29-Oct-07 19:26
ashishbhatt29-Oct-07 19:26 
GeneralRe: Problem with GetBitmapBits() in Win32 Pin
ashishbhatt29-Oct-07 19:08
ashishbhatt29-Oct-07 19:08 
AnswerRe: Problem with GetBitmapBits() in Win32 Pin
Naveen29-Oct-07 20:39
Naveen29-Oct-07 20:39 
GeneralRe: Problem with GetBitmapBits() in Win32 Pin
ashishbhatt29-Oct-07 21:42
ashishbhatt29-Oct-07 21:42 
Questionhow to read an PNG file using c Pin
googlejumbo29-Oct-07 17:49
googlejumbo29-Oct-07 17:49 
AnswerRe: how to read an PNG file using c Pin
Paresh Chitte29-Oct-07 18:27
Paresh Chitte29-Oct-07 18:27 
Questionhow can i search an item in the MFCflexgrid? Pin
panthal29-Oct-07 17:37
panthal29-Oct-07 17:37 
AnswerRe: how can i search an item in the MFCflexgrid? Pin
chandu00429-Oct-07 19:44
chandu00429-Oct-07 19:44 
GeneralRe: how can i search an item in the MFCflexgrid? Pin
panthal29-Oct-07 20:13
panthal29-Oct-07 20:13 
GeneralRe: how can i search an item in the MFCflexgrid? Pin
chandu00429-Oct-07 21:39
chandu00429-Oct-07 21:39 
QuestionRe: how can i search an item in the MFCflexgrid? Pin
panthal29-Oct-07 23:07
panthal29-Oct-07 23:07 
GeneralOfftopic Pin
Nelek29-Oct-07 23:31
protectorNelek29-Oct-07 23:31 

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.