?
Solved

CWnd derived class doesn't drag like a normal window

Posted on 2012-03-13
4
Medium Priority
?
459 Views
Last Modified: 2012-06-21
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++.
0
Comment
Question by:supportoranges
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 37718648
>>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.
0
 
LVL 1

Author Comment

by:supportoranges
ID: 37718678
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();
};
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 1500 total points
ID: 37718821
Your class declaration looks very odd - with things like the PreCreateWindow and LoadFrame being commented out.
0
 
LVL 1

Author Closing Comment

by:supportoranges
ID: 37779566
Sorry have moved on - I assume I have to do more with this class than I am doing.  Thank you for contributing,.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question