Solved

CWnd derived class doesn't drag like a normal window

Posted on 2012-03-13
4
443 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
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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
A short film showing how OnPage and Connectwise integration works.

937 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

7 Experts available now in Live!

Get 1:1 Help Now