Click here to Skip to main content
15,899,474 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: different post message and send message in vc++ Pin
David Crow22-Jan-10 4:15
David Crow22-Jan-10 4:15 
AnswerRe: different post message and send message in vc++ Pin
loyal ginger22-Jan-10 4:47
loyal ginger22-Jan-10 4:47 
QuestionCOM Query Pin
pandit8421-Jan-10 22:27
pandit8421-Jan-10 22:27 
GeneralRe: COM Query Pin
Adam Roderick J21-Jan-10 22:54
Adam Roderick J21-Jan-10 22:54 
AnswerRe: COM Query Pin
Stuart Dootson21-Jan-10 23:02
professionalStuart Dootson21-Jan-10 23:02 
AnswerRe: COM Query Pin
CPallini21-Jan-10 23:39
mveCPallini21-Jan-10 23:39 
GeneralRe: COM Query Pin
pandit8422-Jan-10 0:53
pandit8422-Jan-10 0:53 
GeneralRe: COM Query Pin
CPallini23-Jan-10 2:41
mveCPallini23-Jan-10 2:41 
QuestionA problem about the rubbish on win7 Pin
nenfa21-Jan-10 21:11
nenfa21-Jan-10 21:11 
AnswerRe: A problem about the rubbish on win7 Pin
«_Superman_»22-Jan-10 16:55
professional«_Superman_»22-Jan-10 16:55 
QuestionReplacing some bytes in a file in binary mode Pin
sunny_vc21-Jan-10 20:55
sunny_vc21-Jan-10 20:55 
AnswerRe: Replacing some bytes in a file in binary mode Pin
CPallini21-Jan-10 21:24
mveCPallini21-Jan-10 21:24 
GeneralRe: Replacing some bytes in a file in binary mode Pin
sunny_vc21-Jan-10 21:34
sunny_vc21-Jan-10 21:34 
GeneralRe: Replacing some bytes in a file in binary mode - fixed, thanks to superman Pin
CPallini21-Jan-10 21:44
mveCPallini21-Jan-10 21:44 
GeneralRe: Replacing some bytes in a file in binary mode Pin
«_Superman_»21-Jan-10 22:35
professional«_Superman_»21-Jan-10 22:35 
GeneralRe: Replacing some bytes in a file in binary mode Pin
CPallini22-Jan-10 0:43
mveCPallini22-Jan-10 0:43 
GeneralRe: Replacing some bytes in a file in binary mode Pin
iceman861621-Jan-10 21:48
iceman861621-Jan-10 21:48 
GeneralRe: Replacing some bytes in a file in binary mode Pin
Stuart Dootson21-Jan-10 23:05
professionalStuart Dootson21-Jan-10 23:05 
QuestionFile Manipulation Pin
Chandrasekharan P21-Jan-10 20:03
Chandrasekharan P21-Jan-10 20:03 
AnswerRe: File Manipulation Pin
Rajesh R Subramanian21-Jan-10 20:16
professionalRajesh R Subramanian21-Jan-10 20:16 
AnswerRe: File Manipulation Pin
Cedric Moonen21-Jan-10 20:27
Cedric Moonen21-Jan-10 20:27 
QuestionRe: File Manipulation Pin
David Crow22-Jan-10 4:17
David Crow22-Jan-10 4:17 
QuestionHandle to a video played in a video player Pin
lazy_panther21-Jan-10 19:42
lazy_panther21-Jan-10 19:42 
QuestionCreate function error in CView Class Pin
diarabit21-Jan-10 19:16
diarabit21-Jan-10 19:16 
I found a technical document for adding multiple view to a single document project.
http://msdn.microsoft.com/en-us/library/s199bks0%28VS.80%29.aspx[^]

I made a form view and tried to create it in my project.


When I tried it first, it was succeeded. But when I made it again I got an error message.

It is my code copy from MSDN document.

CView*	pActiveView = ((CFrameWnd*)m_pMainWnd)->GetActiveView();
	m_pOldView = pActiveView;
	m_pSearchView = (CView*)new CSearchMember;
	
	CDocument*	pCurrentDoc = ((CFrameWnd*)m_pMainWnd)->GetActiveDocument();

	CCreateContext newContext;
	newContext.m_pNewViewClass = NULL;
	newContext.m_pNewDocTemplate = NULL;
	newContext.m_pLastView = NULL;
	newContext.m_pCurrentFrame = NULL;
	newContext.m_pCurrentDoc = pCurrentDoc;

	UINT viewID = AFX_IDW_PANE_FIRST+1;
	CRect rect(0,0,0,0);

	m_pSearchView->Create(NULL, NULL, WS_CHILD, rect, m_pMainWnd, viewID, &newContext);
	m_pSearchView->SendMessage(WM_INITIALUPDATE, 0, 0);


In debugging mode, I could find a place occurred error.
BOOL CFormView::Create(LPCTSTR /*lpszClassName*/, LPCTSTR /*lpszWindowName*/,
	DWORD dwRequestedStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
	CCreateContext* pContext)
{
	ASSERT(pParentWnd != NULL);
	ASSERT(m_lpszTemplateName != NULL);

	m_pCreateContext = pContext;    // save state for later OnCreate

#ifdef _DEBUG
	// dialog template must exist and be invisible with WS_CHILD set
	if (!_AfxCheckDialogTemplate(m_lpszTemplateName, TRUE))
	{
		ASSERT(FALSE);          // invalid dialog template name
		PostNcDestroy();        // cleanup if Create fails too soon
		return FALSE;
	}


Because of m_plszTemplateName, this error is occurred.
But I don't know how do I solve.

Please advise for me.
QuestionRe: Create function error in CView Class [modified] Pin
Nelek21-Jan-10 22:28
protectorNelek21-Jan-10 22:28 

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.