My application is a MDI ,devloped by vc++6.0, It is behave good at beginning. after some time It fails to create formview that have activex control created by vb 6.0 .when trace into the mfc ,found the after CoCreateIntance and get the IPersistStreamInit interface ,call it's load method failed .after modify the control ,found that if have image the load from .ico file or have edit textbox control ,the ocx always fail.otherwise it succeed. and found that the dialog created with mfc domodal also fail if the dialog have edit control .
I feel my application has leak some resource in on_updateUIcommand process function. but I don't know what resource leak lead the previous failed result.
help me ,thanks forward

formview and dialog create fail after some time
newtocsharp
You run out of memory... thats the fact.
Maybe you are creating a windows and never destroy them.
Wait for your application to stop. And look at it with the spy++
JaganReddy
thanks for your reply.
My OnUpdateComandUI Call some business logic , it consume a lot cpu time ,nearly always more than 50 percent ,if I comment it then the problem didn't happen after 10 hour, otherwise when cpu time exceed 1 houre ,the problem take place . GDI-handles doesn't grow,but memory dose.
when edit control create fail ,I found that CWnd::DefWindowProc process WM_NCCreate message ,return 0 and GetLastErrro return 0x00000008 ERROR_NOT_ENOUGH_MEMORY,So createwindow return NULL. But I feel odd is that I still can new CEdit then call it's Create method at this time, why wndProc tell ERROR_NOT_ENOUGH_MEMORY. Isn't memory virtually unlimited under win2000
when I stop debug MFC doesn't report any leak. I don't know NOT_ENOUGH_MEMORY means general memory or some special memory
fatboy401
How does you OnUpdateComandUI handler look like
Check the task manager and look at the handle numbers you application is consuming. (GDI-handles growing )
Check GetLastError when the create of the edit control fails.
Are there any leaks reported by the debug environment in the debug output window when you close the application