How to instance a Frame/View program from a dialog based program?

Hi, I am a newbie to MFC.

I wrote a CFrameWnd/CView based program( not a Doc/View based program).

I need to open the former CFrameWnd/CView based program in a dialog program. So I complie my the CFrame/Cview based program as a static lib, and configure the lib dependency and #include file path.

And then, in the dialog program, in a button on click function I, create a new instatnce of CMainFrame to show it.
Here is my code:

CMainFrame* pFrame = new CMainFrame;
pFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();

I complied it successfully, but when I click the button, it says that
"Debug Assertion Failed" @ line 23 of afxwin1.inl....

I have no idea about this. Can any one help me? Any suggestion or hints? Thanks!!
[910 byte] By [powerplane] at [2007-11-18 15:18:39]
# 1 Re: How to instance a Frame/View program from a dialog based program?
Finally got it run...
After adding the resource file to the main app(dialog app) and re-bulit... OK, everything goes fine ....
powerplane at 2007-11-11 1:59:10 >