Link to home
Start Free TrialLog in
Avatar of jmartins71
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::InitInstance()
....
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
            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 :-)
Avatar of jmartins71
jmartins71

ASKER

Sorry about the title but I forgot to complete it :-)
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

Are you using MFC as statically linked?
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/oleuninitialize (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



"I am going to try to do oleinitialize/oleuninitialize "
something.

Since I do not have VStudio in the NT computer the debug is harder!


Adjusted points to 220
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_PAGESCROLLER, NULL, dwStyle, rect, pParentWnd, nID))
        return TRUE;


    AfxMessageBox("error");
    return FALSE;

Why does this happens I do not know!
Can someone help me!
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(CCJPagerCtrl)
public:
....

this code is from www.codeguru.com

And this works in WIN98! My NT computer has 128M of RAM!
MIKEBLAS I am just rejecting in order to reopen the question
ASKER CERTIFIED SOLUTION
Avatar of abancroft
abancroft

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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