First-chance exception in Test.exe (KERNEL32.DLL): 0x0EEDFADE: (no name)
Just add below before you call the DLL.
CoInitialize(NULL);
Day to day work issues we find with windows, mac, unix and internet, software apps etc. we get many many questions and find out some weird things tips and tricks about windows OS that might help others, some of these will help others and help our clients setup software to there requirements.
Wednesday, 15 February 2012
Monday, 6 February 2012
USA federal holidays 2012
| Monday, January 2* | New Year's Day |
| Monday, January 16 | Birthday of Martin Luther King, Jr. |
| Monday, February 20** | Washington's Birthday |
| Monday, May 28 | Memorial Day |
| Wednesday, July 4 | Independence Day |
| Monday, September 3 | Labor Day |
| Monday, October 8 | Columbus Day |
| Monday, November 12*** | Veterans Day |
| Thursday, November 22 | Thanksgiving Day |
| Tuesday, December 25 | Christmas Day |
Wednesday, 1 February 2012
How to fix the CListCtrl MFC C++ lines in middle of item issue bug fix.
Problem:-
fix:-
To fix this bug in the MFC List Control you need to specialize the control, over-ride the method wich responds to the scroll, and force it to redraw the list completely after it has done the scroll.
SmoothListCtrl.cpp
// SmoothListCtrl.cpp : implementation file
//
#include "stdafx.h"
#include "MFC_Sample.h" // your project header
#include "SmoothListCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSmoothListCtrl
CSmoothListCtrl::CSmoothListCtrl()
{
}
CSmoothListCtrl::~CSmoothListCtrl()
{
}
BEGIN_MESSAGE_MAP(CSmoothListCtrl, CListCtrl)
//{{AFX_MSG_MAP(CSmoothListCtrl)
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSmoothListCtrl message handlers
void CSmoothListCtrl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CListCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
Invalidate();
UpdateWindow();
}
SmoothListCtrl.h
#if !defined(AFX_SMOOTHLISTCTRL_H__91716634_7EEA_4555_8977_2F7C96751793__INCLUDED_)
#define AFX_SMOOTHLISTCTRL_H__91716634_7EEA_4555_8977_2F7C96751793__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SmoothListCtrl.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CSmoothListCtrl window
class CSmoothListCtrl : public CListCtrl
{
// Construction
public:
CSmoothListCtrl();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSmoothListCtrl)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSmoothListCtrl();
// Generated message map functions
protected:
//{{AFX_MSG(CSmoothListCtrl)
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SMOOTHLISTCTRL_H__91716634_7EEA_4555_8977_2F7C96751793__INCLUDED_)
fix:-
To fix this bug in the MFC List Control you need to specialize the control, over-ride the method wich responds to the scroll, and force it to redraw the list completely after it has done the scroll.
SmoothListCtrl.cpp
// SmoothListCtrl.cpp : implementation file
//
#include "stdafx.h"
#include "MFC_Sample.h" // your project header
#include "SmoothListCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSmoothListCtrl
CSmoothListCtrl::CSmoothListCtrl()
{
}
CSmoothListCtrl::~CSmoothListCtrl()
{
}
BEGIN_MESSAGE_MAP(CSmoothListCtrl, CListCtrl)
//{{AFX_MSG_MAP(CSmoothListCtrl)
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSmoothListCtrl message handlers
void CSmoothListCtrl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CListCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
Invalidate();
UpdateWindow();
}
SmoothListCtrl.h
#if !defined(AFX_SMOOTHLISTCTRL_H__91716634_7EEA_4555_8977_2F7C96751793__INCLUDED_)
#define AFX_SMOOTHLISTCTRL_H__91716634_7EEA_4555_8977_2F7C96751793__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SmoothListCtrl.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CSmoothListCtrl window
class CSmoothListCtrl : public CListCtrl
{
// Construction
public:
CSmoothListCtrl();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSmoothListCtrl)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSmoothListCtrl();
// Generated message map functions
protected:
//{{AFX_MSG(CSmoothListCtrl)
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SMOOTHLISTCTRL_H__91716634_7EEA_4555_8977_2F7C96751793__INCLUDED_)
Subscribe to:
Posts (Atom)