Solved

CWnd derived class doesn't drag like a normal window

Posted on 2012-03-13
4
437 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
  • 2
  • 2
4 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
>>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
Comment Utility
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 500 total points
Comment Utility
Your class declaration looks very odd - with things like the PreCreateWindow and LoadFrame being commented out.
0
 
LVL 1

Author Closing Comment

by:supportoranges
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now