Click here to Skip to main content
15,847,583 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Create bitmap Pin
Justin Tay4-Jul-06 1:39
Justin Tay4-Jul-06 1:39 
QuestionReplacing Windows' copy manager (?) Pin
smithjunior4-Jul-06 0:59
smithjunior4-Jul-06 0:59 
QuestionResize SpliterWnd on CFrameWnd Pin
huynhnb4-Jul-06 0:50
huynhnb4-Jul-06 0:50 
QuestionCommunication from Dialog to CFormView Pin
Uday Janaswamy4-Jul-06 0:36
Uday Janaswamy4-Jul-06 0:36 
AnswerRe: Communication from Dialog to CFormView Pin
Weiye Chen4-Jul-06 0:39
Weiye Chen4-Jul-06 0:39 
GeneralRe: Communication from Dialog to CFormView Pin
Uday Janaswamy4-Jul-06 4:17
Uday Janaswamy4-Jul-06 4:17 
AnswerRe: Communication from Dialog to CFormView Pin
huynhnb4-Jul-06 0:55
huynhnb4-Jul-06 0:55 
GeneralRe: Communication from Dialog to CFormView [modified] Pin
Uday Janaswamy4-Jul-06 4:07
Uday Janaswamy4-Jul-06 4:07 
hi,

i am getting null value when i use the above code please help me out.


//================================================================

CFrameWnd *pMainFrame = (CFrameWnd*)RUNTIME_CLASS(kiranfrm)->CreateObject();
if(pMainFrame->m_hWnd == NULL)
{
//I am getting Null value here so i cant able to create a Handle.
}

//================================================================

Steps what i have done.

1) Create a Dialog and place a Button and in the Click even i pasted what you have mentioned.
2) Create a CForm and create CFormClass,CFormDoc Class,CFrameWnd Class.



//here is the Total Code please see it

CFrameWnd *pMainFrame = (CFrameWnd*)RUNTIME_CLASS(kiranfrm)->CreateObject();
if(pMainFrame->m_hWnd == NULL)
{
MessageBox("hellow");
return ;
}

CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(128,
RUNTIME_CLASS(kirandoc),
RUNTIME_CLASS(kiranfrm),
RUNTIME_CLASS(kiran));

CCreateContext sContext;
sContext.m_pCurrentDoc = (CDocument*) RUNTIME_CLASS(kirandoc)->CreateObjec();
sContext.m_pCurrentFrame = NULL;
sContext.m_pLastView = NULL;
sContext.m_pNewDocTemplate = pDocTemplate;
sContext.m_pNewViewClass = RUNTIME_CLASS(kiran);

pMainFrame ->Create("", _T(""), WS_CHILD, CRect(0,0,1,1), this, NULL, 0, &sContext);
pMainFrame ->MoveWindow(0,0,200,200); //Error
pMainFrame ->ShowWindow(SW_SHOW); //Error

because m_hWnd is NULL.

-- modified at 9:09 Tuesday 4th July, 2006
GeneralRe: Communication from Dialog to CFormView Pin
huynhnb4-Jul-06 17:32
huynhnb4-Jul-06 17:32 
GeneralRe: Communication from Dialog to CFormView Pin
Uday Janaswamy4-Jul-06 19:36
Uday Janaswamy4-Jul-06 19:36 
GeneralRe: Communication from Dialog to CFormView Pin
Uday Janaswamy5-Jul-06 19:26
Uday Janaswamy5-Jul-06 19:26 
AnswerRe: Communication from Dialog to CFormView Pin
Hamid_RT4-Jul-06 3:03
Hamid_RT4-Jul-06 3:03 
Questiona snapshot Pin
V_shr4-Jul-06 0:35
V_shr4-Jul-06 0:35 
AnswerRe: a snapshot Pin
Justin Tay4-Jul-06 0:49
Justin Tay4-Jul-06 0:49 
QuestionCommunication between Two Dialog Pin
Amit Agarrwal4-Jul-06 0:28
Amit Agarrwal4-Jul-06 0:28 
AnswerRe: Communication between Two Dialog Pin
_AnsHUMAN_ 4-Jul-06 0:36
_AnsHUMAN_ 4-Jul-06 0:36 
GeneralRe: Communication between Two Dialog Pin
Amit Agarrwal4-Jul-06 0:44
Amit Agarrwal4-Jul-06 0:44 
GeneralRe: Communication between Two Dialog Pin
_AnsHUMAN_ 4-Jul-06 0:51
_AnsHUMAN_ 4-Jul-06 0:51 
GeneralRe: Communication between Two Dialog Pin
Amit Agarrwal4-Jul-06 1:12
Amit Agarrwal4-Jul-06 1:12 
GeneralRe: Communication between Two Dialog Pin
Amit Agarrwal4-Jul-06 1:51
Amit Agarrwal4-Jul-06 1:51 
AnswerRe: Communication between Two Dialog Pin
Weiye Chen4-Jul-06 0:45
Weiye Chen4-Jul-06 0:45 
QuestionLoading the correct icons Pin
Remco Hoogenboezem4-Jul-06 0:27
Remco Hoogenboezem4-Jul-06 0:27 
Questionoutput to CSV file Pin
PhilWalker4-Jul-06 0:16
PhilWalker4-Jul-06 0:16 
AnswerRe: output to CSV file Pin
*Dreamz4-Jul-06 0:40
*Dreamz4-Jul-06 0:40 
GeneralRe: output to CSV file Pin
PhilWalker4-Jul-06 0:53
PhilWalker4-Jul-06 0:53 

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.