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 :-)
jmartins71Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

0
shaigCommented:
Are you using MFC as statically linked?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

jmartins71Author Commented:
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



0
jmartins71Author Commented:
"I am going to try to do oleinitialize/oleuninitialize "
something.

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


0
jmartins71Author Commented:
Adjusted points to 220
0
jmartins71Author Commented:
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!
0
jmartins71Author Commented:
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!
0
jmartins71Author Commented:
MIKEBLAS I am just rejecting in order to reopen the question
0
abancroftCommented:
I am familiar with the CCJPagerCtrl. It wraps the Pager control that was introduced with comctl32.dll v4.71 (which was part of IE4).

Check the version of this DLL on the NT PC (it's in C:\WINNT\SYSTEM32). If it's less than 4.71, that's the problem.

To resolve this, you can download the latest version of comctl32.dll from the microsoft web site. Search for 50comupd.exe.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jmartins71Author Commented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.