Solved

CWnd derived class doesn't drag like a normal window

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 105
WPF MainWindow update textbox from another class... 6 147
What are the big features of MVC5? 4 91
Dialogbox API leak? 18 98
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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