InitInstance() Problem
-
Hi, In my application, first the CMainFrame construcotr is getting called and then only InitInstance() is called. What may be the problem? Pls help me.
Anu
-
Hi, In my application, first the CMainFrame construcotr is getting called and then only InitInstance() is called. What may be the problem? Pls help me.
Anu
Hi Anu, we will not be able to help you much if you do not post some relevant code, perhaps your constructor and the context from which it is called.
For awesome websites or just to chat check out my blog for more info. . .
-
Hi, In my application, first the CMainFrame construcotr is getting called and then only InitInstance() is called. What may be the problem? Pls help me.
Anu
Normally, the
CMainFrame
object is constructed in theInitInstance
method using the call -pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CSDIDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CSDIView));Do you see this call in InitInstance? If you don't see this, it means that the construction is being done elsewhere; your app class constructor perhaps. If you do see the above code and you still have the behavior you mentioned, it could mean that some other
CMainFrame
instance is being constructed. Whatever the case, it is not the correct way to do it.«_Superman_» _I love work. It gives me something to do between weekends.
-
Hi, In my application, first the CMainFrame construcotr is getting called and then only InitInstance() is called. What may be the problem? Pls help me.
Anu
-
That would stop execution in its tracks...