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.

  1. why crash occur?
  2. how fix crash?
  3. 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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -