BUG: English Query MFC Sample Gives AV on Win98

ID: Q216338


The information in this article applies to:
  • Microsoft English Query, version 7.0


SYMPTOMS

The English Query Visual C++ MFC sample that ships with SQL Server 7.0, gives an access violation when built and run on Win98. The debugger stops at the following line in the AfxWin2.inl file if run under debug mode:


_AFXWIN_INLINE void CWnd::SetFont(CFont* pFont, BOOL bRedraw)
	{ ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_SETFONT, (WPARAM)pFont->GetSafeHandle(), bRedraw); } 


CAUSE

The problem is caused by two resources on MFCEQUI_DIALOG that have the same ID.


WORKAROUND

To work around the problem, rename one of the IDs as described below:

  1. Search for "IDC_STATIC" in MfcequiDlg.cpp and replace with IDC_mySTATIC. The MfcequiDlg.cpp file can be found in the C:\Microsoft English Query\Samples\Mfcui directory. The lines to change are:

    
    Line 222: CWnd *pWnd = GetDlgItem(IDC_STATIC); 
    Line 230 : SetDlgItemText(IDC_STATIC, "Welcome to Microsoft English Query"); 


  2. Change the resource property to say IDC_mySTATIC for the blank static box on MFCEQUI_DIALOG.


  3. Rebuild the application.



STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Additional query words: EQ

Keywords : kbDatabase kbMFC kbVC kbEngQuery
Version : NT:7.0
Platform : NT
Issue type : kbbug


Last Reviewed: October 22, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.