LindaP
April 11th, 1999, 12:19 PM
Application: MDI
Compiler: MSDev4.2
I have a modeless dialog which is causing an exception in AfxCallWndProc upon the exit from a function. The top of the call stack ends up pointing to the line
pThreadState->m_lastSentMsg = oldState;
(pThreadState has a value, but all of it's variables are listed as undefined.)
I have absolutely no idea what causes this problem, or how to find the error.
The function in question responds to a left double-click, and is intended to activate an existing doc/view, or create a new doc/view if it doesn't exist. The function code is as follows:
void CCStationListDlg::OnDblclkStations(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CListCtrl *poList = (CListCtrl*)GetDlgItem(IDC_STATIONS);
LV_ITEM sItem;
CCAcpApp *poApp = (CCAcpApp*) AfxGetApp();
CCAcpDoc *poDoc;
sItem.iItem = poList->GetNextItem( -1, LVNI_SELECTED );
if ( sItem.iItem != -1 )
{
sItem.mask = LVIF_TEXT | LVIF_PARAM;
sItem.iSubItem = 0;
poList->GetItem( &sItem );
poDoc = poApp->GetAcpDocById( (ccULong) sItem.lParam );
if ( poDoc )
poDoc->ActivateView(); // bring view to top (restore if necessary from minimized.)
else
poApp->CreateNewAcpDocument( sItem.lParam );
}
*pResult = 0;
}
The exception occurs whether a view is activated or a new doc/view created.
I'm pretty much a novice on the windowing side of msdev, so any help would be muchly appreciated.
Compiler: MSDev4.2
I have a modeless dialog which is causing an exception in AfxCallWndProc upon the exit from a function. The top of the call stack ends up pointing to the line
pThreadState->m_lastSentMsg = oldState;
(pThreadState has a value, but all of it's variables are listed as undefined.)
I have absolutely no idea what causes this problem, or how to find the error.
The function in question responds to a left double-click, and is intended to activate an existing doc/view, or create a new doc/view if it doesn't exist. The function code is as follows:
void CCStationListDlg::OnDblclkStations(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CListCtrl *poList = (CListCtrl*)GetDlgItem(IDC_STATIONS);
LV_ITEM sItem;
CCAcpApp *poApp = (CCAcpApp*) AfxGetApp();
CCAcpDoc *poDoc;
sItem.iItem = poList->GetNextItem( -1, LVNI_SELECTED );
if ( sItem.iItem != -1 )
{
sItem.mask = LVIF_TEXT | LVIF_PARAM;
sItem.iSubItem = 0;
poList->GetItem( &sItem );
poDoc = poApp->GetAcpDocById( (ccULong) sItem.lParam );
if ( poDoc )
poDoc->ActivateView(); // bring view to top (restore if necessary from minimized.)
else
poApp->CreateNewAcpDocument( sItem.lParam );
}
*pResult = 0;
}
The exception occurs whether a view is activated or a new doc/view created.
I'm pretty much a novice on the windowing side of msdev, so any help would be muchly appreciated.