Click here to Skip to main content
16,006,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCustom Window Messages Pin
x87Bliss20-Mar-07 15:59
x87Bliss20-Mar-07 15:59 
AnswerRe: Custom Window Messages Pin
Mark Salsbery20-Mar-07 16:23
Mark Salsbery20-Mar-07 16:23 
GeneralRe: Custom Window Messages Pin
ppp00120-Mar-07 16:37
ppp00120-Mar-07 16:37 
GeneralRe: Custom Window Messages Pin
Mark Salsbery20-Mar-07 16:40
Mark Salsbery20-Mar-07 16:40 
AnswerRe: Custom Window Messages Pin
Roger Stoltz20-Mar-07 21:57
Roger Stoltz20-Mar-07 21:57 
QuestionMessage Removed Pin
20-Mar-07 13:46
Armond Sarkisian20-Mar-07 13:46 
AnswerRe: CString Conversion Pin
Michael Dunn20-Mar-07 15:47
sitebuilderMichael Dunn20-Mar-07 15:47 
QuestionApplication Crash Pin
AAKAra20-Mar-07 9:00
AAKAra20-Mar-07 9:00 
My project is an MFC application; i am running into an application crash when user tries to select an object from the browse window. This does not happened when the user tries to do it with a single click, this happens only when user tries to drag the object a little bit while selecting. I have an option of making a copy of the object when the user tries to drag and drop it, but if the right click and drag is bit fast then the application crashes.
Crash happens at the line DISABLEOLEWARNINGBOXS,
<br />
void CInstanceListCtrl::OnBegindrag(NMHDR* /*pNMHDR*/, LRESULT* pResult) <br />
{<br />
//NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;<br />
*pResult = 0;<br />
<br />
// If no drop effects are allowed then just exit.<br />
if (0 == m_dropEffectAllowed) return;<br />
<br />
// Create an item list for all of the selected objects.<br />
CPyrItemList* ppil = CreateSelectedItemList (m_fIgnoreClassFoldersInLists);<br />
if (NULL == ppil) return;<br />
<br />
// If we drag the data to another process and it takes a long time<br />
// to complete the drop, it's possible for us to get "server busy"<br />
// dialogs while we're waiting for the other process. So we want<br />
// to turn off those dialogs now.<br />
DISABLEOLEWARNINGBOXS;<br />
<br />
// Create a data source to do the drag-drop and then do the<br />
// drag-drop.<br />
CPyrItemListDataSource DataSource;<br />
DataSource.Create (*ppil);<br />
/*DROPEFFECT dropEffect = */ DataSource.DoDragDrop (m_dropEffectAllowed);<br />
delete ppil;<br />
}<br />

and DISABLEOLEWARNINGBOXS refers to

<br />
#define DISABLEOLEWARNINGBOXS \<br />
COleMessageFilter* pfilter = ::AfxOleGetMessageFilter (); \<br />
if (NULL != pfilter) \<br />
{ \<br />
pfilter->EnableBusyDialog(FALSE); \<br />
pfilter->EnableNotRespondingDialog(FALSE); \<br />
}<br />



the call stack shows


mfc71d.dll!AfxAssertValidObject(const CObject * pOb=0x00000000, const char * lpszFileName=0x7c142b9c, int nLine=33) Line 75 C++
mfc71d.dll!AfxOleGetMessageFilter() Line 33 + 0x15 C++
Util.dll!CInstanceListCtrl::OnBegindrag(tagNMHDR * __formal=0x03f5a9ac, long * pResult=0x03f5a664) Line 2590 + 0x5 C++
mfc71d.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x03f5c444, unsigned int nID=0, int nCode=65427, void (void)* pfn=0x0072db00, void * pExtra=0x03f5a3d0, unsigned int nSig=57, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 119 C++
mfc71d.dll!CCmdTarget::OnCmdMsg(unsigned int nID=0, int nCode=65427, void * pExtra=0x03f5a3d0, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 396 + 0x27 C++
mfc71d.dll!CWnd::ReflectChildNotify(unsigned int uMsg=78, unsigned int wParam=1024, long lParam=66431404, long * pResult=0x03f5a664) Line 3251 + 0x23 C++
mfc71d.dll!CWnd::OnChildNotify(unsigned int uMsg=78, unsigned int wParam=1024, long lParam=66431404, long * pResult=0x03f5a664) Line 3205 C++
mfc71d.dll!CListCtrl::OnChildNotify(unsigned int message=78, unsigned int wParam=1024, long lParam=66431404, long * pResult=0x03f5a664) Line 606 + 0x18 C++
mfc71d.dll!CWnd::SendChildNotifyLastMsg(long * pResult=0x03f5a664) Line 3145 C++
mfc71d.dll!CWnd::ReflectLastMsg(HWND__ * hWndChild=0x000307b8, long * pResult=0x03f5a664) Line 3183 C++
mfc71d.dll!CWnd::OnNotify(unsigned int __formal=1024, long lParam=66431404, long * pResult=0x03f5a664) Line 2569 + 0xd C++
SelDlg.dll!0136999e()
mfc71d.dll!CWnd::OnWndMsg(unsigned int message=78, unsigned int wParam=1024, long lParam=66431404, long * pResult=0x03f5a698) Line 1771 + 0x28 C++
mfc71d.dll!CWnd::WindowProc(unsigned int message=78, unsigned int wParam=1024, long lParam=66431404) Line 1745 + 0x1e C++
mfc71d.dll!AfxCallWndProc(CWnd * pWnd=0x03f5b0b4, HWND__ * hWnd=0x000307de, unsigned int nMsg=78, unsigned int wParam=1024, long lParam=66431404) Line 241 + 0x1a C++
mfc71d.dll!AfxWndProc(HWND__ * hWnd=0x000307de, unsigned int nMsg=78, unsigned int wParam=1024, long lParam=66431404) Line 389 C++


Can someone suggest me how to get around this problem?

Anil
AnswerRe: Application Crash Pin
PJ Arends20-Mar-07 11:14
professionalPJ Arends20-Mar-07 11:14 
AnswerRe: Application Crash Pin
prasad_som20-Mar-07 18:18
prasad_som20-Mar-07 18:18 
GeneralRe: Application Crash Pin
AAKAra21-Mar-07 5:46
AAKAra21-Mar-07 5:46 
AnswerRe: Application Crash Pin
prasad_som21-Mar-07 7:43
prasad_som21-Mar-07 7:43 
QuestionC++ dll that can be accessed by Cold Fusion Pin
LCI20-Mar-07 8:50
LCI20-Mar-07 8:50 
AnswerRe: C++ dll that can be accessed by Cold Fusion Pin
Michael Dunn20-Mar-07 15:50
sitebuilderMichael Dunn20-Mar-07 15:50 
Questionautomate an already-launched visual studio IDE Pin
ppp00120-Mar-07 8:00
ppp00120-Mar-07 8:00 
QuestionCommon Controls 6 and porting from VS2003 to VS2005 Pin
Christopher Duncan20-Mar-07 7:02
Christopher Duncan20-Mar-07 7:02 
Questionowner-drawn button Pin
iayd20-Mar-07 6:59
iayd20-Mar-07 6:59 
AnswerRe: owner-drawn button Pin
toxcct20-Mar-07 7:12
toxcct20-Mar-07 7:12 
AnswerRe: owner-drawn button Pin
johny_d20-Mar-07 12:37
johny_d20-Mar-07 12:37 
QuestionCImage Woes Pin
VonHagNDaz20-Mar-07 5:32
VonHagNDaz20-Mar-07 5:32 
AnswerRe: CImage Woes Pin
Dave Calkins20-Mar-07 5:44
Dave Calkins20-Mar-07 5:44 
GeneralRe: CImage Woes Pin
VonHagNDaz20-Mar-07 5:53
VonHagNDaz20-Mar-07 5:53 
GeneralRe: CImage Woes Pin
Mark Salsbery20-Mar-07 8:47
Mark Salsbery20-Mar-07 8:47 
QuestionRe: CImage Woes Pin
David Crow20-Mar-07 7:24
David Crow20-Mar-07 7:24 
AnswerRe: CImage Woes Pin
VonHagNDaz20-Mar-07 8:06
VonHagNDaz20-Mar-07 8:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.