Hi,
I am trying to use MessageBox in OnInitialUpdate function but its giving me "Debug Assertion Failed Message"
File: f:\dd\vctools\crt_bld\self_x86\crt\src\vsprintf.c
Line:244
I am using the following code:
Code:
void CRotateImageView::OnInitialUpdate()
{
	int k;char str[2];
	CView::OnInitialUpdate();
	
	CString szStr,szstr1;
	szStr= "D:\\image\\after_cut2.jpeg";
	k=img.Load(szStr);
        sprintf_s(str,2, "%d",k);
	szstr1=(CString)str;
	MessageBox(szstr1);
	
}
However when i am using the same code in OnDraw its working.


Code:

void Csprintf_sEGView::OnDraw(CDC* /*pDC*/)
{
	Csprintf_sEGDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

	int k;char str[2];
	
	CString szStr,szstr1;
	
	
    sprintf_s(str,2, "%d",1);
	szstr1=(CString)str;
	MessageBox(szstr1);

	// TODO: add draw code for native data here
}
Somebody plz help me with this problem.

Zulfi.