jmartins71
asked on
fail
Hi,
I have the following problem with my MFC SDI application:
Everything works fine in WIN98 (I am running VSTUDIO in WIN98) but when I have tried in WIN NT I got the following dialog box "Failed to create empty document" and nothing more.
I have find the peace of code that is doing this:
BOOL CWinLoaderApp::InitInstanc e()
....
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI nfo))
return FALSE;
....
This has been written by MFC APP WIZARD so what is the problem!?
Thanks in advance for everyone that reads this and sorry about my English :-)
I have the following problem with my MFC SDI application:
Everything works fine in WIN98 (I am running VSTUDIO in WIN98) but when I have tried in WIN NT I got the following dialog box "Failed to create empty document" and nothing more.
I have find the peace of code that is doing this:
BOOL CWinLoaderApp::InitInstanc
....
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI
return FALSE;
....
This has been written by MFC APP WIZARD so what is the problem!?
Thanks in advance for everyone that reads this and sorry about my English :-)
This error message means exactly what it says: MFC has tried to create a new, empty document and has failed doing so.
There are a few causes to this problem:
1) The CDocument constructor has thrown an exception.
2) The CDocument was created, but the associated CView's constructor has thrown an exception.
3) The CView C++ object was created successfully, but for some reason the window associated with the CView could not be created. There are several possible causes:
3a) Not enough memory.
3b) A class the view wants to use isn't registered. For example, you have a CRichEditView but you never called AfxInitRichEdit() to get the rich edit control loaded and registered.
3c) An OLE object the view wants to use isn't registered. For example, you have a CFormView with an OLE control in it and that OLE Control isn't registered.
Exactly which cause you're exactly experiencing is determined by debugging the application.
..B ekiM
There are a few causes to this problem:
1) The CDocument constructor has thrown an exception.
2) The CDocument was created, but the associated CView's constructor has thrown an exception.
3) The CView C++ object was created successfully, but for some reason the window associated with the CView could not be created. There are several possible causes:
3a) Not enough memory.
3b) A class the view wants to use isn't registered. For example, you have a CRichEditView but you never called AfxInitRichEdit() to get the rich edit control loaded and registered.
3c) An OLE object the view wants to use isn't registered. For example, you have a CFormView with an OLE control in it and that OLE Control isn't registered.
Exactly which cause you're exactly experiencing is determined by debugging the application.
..B ekiM
Are you using MFC as statically linked?
ASKER
shaig: "Are you using MFC as statically linked?
" - YES
mikeblas:
1) 2) If is someone of this why does this not happens on WIN98!? I have tested in several computers with WIN98!
3a) something
3b 3c I am going to try to do oleinitialize/oleuninitial ize (I will send one comment of the result)
I am not using components and my views are:
1)LeftView from CView
splitted with
2)ContainerView from CView
In the containerview I have two splitted views:
1)ListView from CListView
2)InfoView from CView
" - YES
mikeblas:
1) 2) If is someone of this why does this not happens on WIN98!? I have tested in several computers with WIN98!
3a) something
3b 3c I am going to try to do oleinitialize/oleuninitial
I am not using components and my views are:
1)LeftView from CView
splitted with
2)ContainerView from CView
In the containerview I have two splitted views:
1)ListView from CListView
2)InfoView from CView
ASKER
"I am going to try to do oleinitialize/oleuninitial ize "
something.
Since I do not have VStudio in the NT computer the debug is harder!
something.
Since I do not have VStudio in the NT computer the debug is harder!
ASKER
Adjusted points to 220
ASKER
I have found the offending code:
In my LeftView::OnCreate I have:
// Create the pager control and set its parent to 'this'
if (!m_Pager.Create(WS_CHILD| WS_VISIBLE |PGS_VERT,
CRect(0,0,0,0), this, IDC_STATIC ))
{
TRACE0("Failed to create CPagerCtrl...\n");
return -1;
}
and the create fails.
the create is:
CWnd* pWnd = this;
if (pWnd->Create(WC_PAGESCROL LER, NULL, dwStyle, rect, pParentWnd, nID))
return TRUE;
AfxMessageBox("error");
return FALSE;
Why does this happens I do not know!
Can someone help me!
In my LeftView::OnCreate I have:
// Create the pager control and set its parent to 'this'
if (!m_Pager.Create(WS_CHILD|
CRect(0,0,0,0), this, IDC_STATIC ))
{
TRACE0("Failed to create CPagerCtrl...\n");
return -1;
}
and the create fails.
the create is:
CWnd* pWnd = this;
if (pWnd->Create(WC_PAGESCROL
return TRUE;
AfxMessageBox("error");
return FALSE;
Why does this happens I do not know!
Can someone help me!
ASKER
Just to complete the last comment:
m_Pager is:
// CCJPagerCtrl is a CWnd derived class which wraps the windows
// Pager common control.
class CCJPagerCtrl : public CWnd
{
DECLARE_DYNAMIC(CCJPagerCt rl)
public:
....
this code is from www.codeguru.com
And this works in WIN98! My NT computer has 128M of RAM!
m_Pager is:
// CCJPagerCtrl is a CWnd derived class which wraps the windows
// Pager common control.
class CCJPagerCtrl : public CWnd
{
DECLARE_DYNAMIC(CCJPagerCt
public:
....
this code is from www.codeguru.com
And this works in WIN98! My NT computer has 128M of RAM!
ASKER
MIKEBLAS I am just rejecting in order to reopen the question
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Abancroft: you are probably wright.
I have run it in NT with SP1
I ask a friend with NT SP5 and everything went well.
I am going to try to find the comctl32.dll
As your answer give me the good way to follow I will accept your comment as my answer
Thank you
I have run it in NT with SP1
I ask a friend with NT SP5 and everything went well.
I am going to try to find the comctl32.dll
As your answer give me the good way to follow I will accept your comment as my answer
Thank you
ASKER