Avatar of supportoranges
supportoranges
Flag for United States of America asked on

CWnd derived class doesn't drag like a normal window

I have created a CWnd derived class but it doesn't drag like a normal window.   It will end up where I drop it but the moving of the window is not rendering.

I have just started working on this CWnd derived class and am currently overriding the OnPaint handler.

Microsoft Visual Studio 2010 on Windows 7 32-bit. platform using Visual C++.
Microsoft Development

Avatar of undefined
Last Comment
supportoranges

8/22/2022 - Mon
AndyAinscow

>>am currently overriding the OnPaint handler.

Which is why it isn't working like normal - you are obviously not doing something that the default OnPaint would be doing.
supportoranges

ASKER
Thank you for your feedback.  Even if I comment out the paint message (as below) the problem doesn't go away.  (void CMyFrame::OnPaint() not called)

BEGIN_MESSAGE_MAP(CMyFrame, CWnd)
    //{{AFX_MSG_MAP(CMyWnd)
    //ON_WM_PAINT()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()


//HERE IS THE CLASS DECLARATION - missing something?
class CMyFrame : public CWnd
{
      DECLARE_DYNAMIC(CMyFrame)
public:
      CMyFrame();
// Attributes
public:    
// Operations
public:
      //virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
      //virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL);
// Implementation
public:
      virtual ~CMyFrame(){};
#ifdef _DEBUG
      virtual void AssertValid() const;
      virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected: // the AFX_MSG is for Class Wizard
    //{{AFX_MSG(CMyWnd)
    //}}AFX_MSG
      DECLARE_MESSAGE_MAP()
public:
      afx_msg void OnPaint();
};
ASKER CERTIFIED SOLUTION
AndyAinscow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
supportoranges

ASKER
Sorry have moved on - I assume I have to do more with this class than I am doing.  Thank you for contributing,.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes