Do you create this control on class method??? If yes where placed define you control and use new operator If for instance you declared you control in some method of you class and after used new operator and create function then after exit from this method you recieve exactly you trouble. I.e bool YouClass::SomeMethod(){ CSampleControl* control; control = new CSampleControl(); control->Create( "", "", WS_CHILD, this, 1000 ); return true;//exit from method and recived exception } Also you may not call AfxEnableControlContainer(); on InitInstaced method of you application