ACC1x: GP Fault with PostMessage() to an ADK Application

Last reviewed: June 8, 1997
Article ID: Q105520
The information in this article applies to:
  • Microsoft Access Distribution Kit version 1.1

SYMPTOMS

If you attempt to close a Microsoft Access Distribution Kit application by sending a WM_CLOSE message from another application using the PostMessage() Windows API function call, a general protection (GP) fault will occur.

The sample code

   x = PostMessage(hWnd, WM_CLOSE, 0, 0)

will result in a GP fault when run in languages such as Microsoft Visual Basic, Microsoft Windows C, or Access Basic.

RESOLUTION

Use the WM_DESTROY window message instead of the WM_CLOSE message to close a run-time application. The following sample code demonstrates how to use the WM_DESTROY message:

   x = PostMessage(hWnd, WM_DESTROY, 0, 0)

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Access Distribution Kit version 1.1. This problem no longer occurs in the Microsoft Access Developer's Toolkit version 2.0.

REFERENCES

Microsoft Windows version 3.1 "Programmer's Reference," Volume 2


Additional query words: GPF ADK
Keywords : EvnGpf kberrmsg kbprg PgmApi
Version : 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.