How to create and use CView inherited objects inside a frame in MFC? -
i created mfc sdi application without document/view using wizard in vs2008. want replace default created child control of cchildview splitter 2 ceditviews. creation works, application crashes when input character edit view.
- why crash occur?
- how fix crash?
- how access instances of created views?
mainframe.h:
class mainframe : public cframewnd { public: virtual bool oncreateclient(lpcreatestruct lpcs, ccreatecontext* pcontext); private: csplitterwnd splitter; // ... };
mainframe.cpp
bool mainframe::oncreateclient(lpcreatestruct lpcs, ccreatecontext* pcontext) { splitter.createstatic(this, 1, 2); splitter.createview(0, 0, runtime_class(ceditview), csize(0, 0), pcontext); splitter.createview(0, 1, runtime_class(ceditview), csize(0, 0), pcontext); return true; }
this article looks example of replacing default sdi view: http://simplesamples.info/mfc/withouttemplates.php
Comments
Post a Comment