Debug Assertion in Appui.cpp. DocManager == NULL

Hello,

My Win32 Service is making a debug assertion before it
comes up in Appui.cpp line 91. This file is part of
MFC library. The code is as follows in appui.cpp

CDocument* CWinApp::OpenDocumentFile(LPCTSTR
lpszFileName)
{
ASSERT(m_pDocManager != NULL); // line 91
return m_pDocManager->OpenDocumentFile(lpszFileName);
}

from the code it is clear that an OpenDocumentFile
call has come when m_pDocManager is pointing to NULL.
Can anyone tell me why this call is being called
before docmanager can point to something…Whats wrong
with my service. When all this call is made ???

Thanks in anticipation.
Girish


Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

> My Win32 Service is making a debug assertion before it

comes up in Appui.cpp line 91. This file is part of
MFC library. The code is as follows in appui.cpp

Use main() in your service, not WinMain(). Build it as a console app.
You will be able to use MFC’s strings and containers there - and, with some
hack in the beginning of main(), will be able to use MFC’s resource code.

Max