bsmanoj
April 8th, 1999, 03:16 AM
Hello,
My function code segment is as follows:
void CMainFrame::OnLineOpen()
{
// TODO: Add your command handler code here
LPHDRVLINE lphdLine;
HTAPILINE htLine;
retVal = TSPI_lineOpen(2, htLine, lphdLine, TSPIVERSION, NULL);
sprintf(str, "TSPI_lineOpen retVal = %d", retVal);
AfxMessageBox(str);
return;
}
The above function accesses a proprietory DLL inturn.
On Successful return of the OnLineOpen() function, I get an Unhandled Exception: Access violation error and the debugger points to the code:
CWnd* pMainWnd = AfxGetMainWnd();
if (pMainWnd == NULL || !pMainWnd->IsFrameWnd())
return;
in void CWinApp::EnableModeless(BOOL bEnable)
AfxGetMainWnd() returns the app window handle to pMainWnd. So, it is not NULL. But pMainWnd is of CFrameWnd type and the member function IsFrameWnd() is not found anywhere.
Kindly help at the earliest.
ThankU.
Regards,
BSManoj
The callstack is shown below:
CWinApp::EnableModeless(int 0) line 79 + 20 bytes
CWinApp::DoMessageBox(char * 0x00404320, unsigned int 0, unsigned int 0) line 98
AfxMessageBox(char * 0x00404320, unsigned int 0, unsigned int 0) line 168
CMainFrame::OnLineOpen() line 241
Please help me!! I am not able to understand what the problem is!!
Thanks in advance
My function code segment is as follows:
void CMainFrame::OnLineOpen()
{
// TODO: Add your command handler code here
LPHDRVLINE lphdLine;
HTAPILINE htLine;
retVal = TSPI_lineOpen(2, htLine, lphdLine, TSPIVERSION, NULL);
sprintf(str, "TSPI_lineOpen retVal = %d", retVal);
AfxMessageBox(str);
return;
}
The above function accesses a proprietory DLL inturn.
On Successful return of the OnLineOpen() function, I get an Unhandled Exception: Access violation error and the debugger points to the code:
CWnd* pMainWnd = AfxGetMainWnd();
if (pMainWnd == NULL || !pMainWnd->IsFrameWnd())
return;
in void CWinApp::EnableModeless(BOOL bEnable)
AfxGetMainWnd() returns the app window handle to pMainWnd. So, it is not NULL. But pMainWnd is of CFrameWnd type and the member function IsFrameWnd() is not found anywhere.
Kindly help at the earliest.
ThankU.
Regards,
BSManoj
The callstack is shown below:
CWinApp::EnableModeless(int 0) line 79 + 20 bytes
CWinApp::DoMessageBox(char * 0x00404320, unsigned int 0, unsigned int 0) line 98
AfxMessageBox(char * 0x00404320, unsigned int 0, unsigned int 0) line 168
CMainFrame::OnLineOpen() line 241
Please help me!! I am not able to understand what the problem is!!
Thanks in advance