Default Handling of VBX Events

Last reviewed: July 22, 1997
Article ID: Q119063
1.00 1.50 WINDOWS kbprg

The information in this article applies to:

   The Microsoft Foundation Classes (MFC) included with:
    - Microsoft Visual C++ for Windows, versions 1.0 and 1.5

SUMMARY

The VBX emulation layer provided by MFC will not send an event notification unless the event has been registered. However, it might be desirable to provide handling for non-registered VBX events. This could be used for providing diagnostic information for all events that a VBX dispatches which aren't handled by an application.

MORE INFORMATION

When a VBX event occurs MFC will search through all registered events (registered using AfxRegisterVBEvent) to find the notification code for the particular event which occurred. If the event has not been registered then MFC will look for a default event. This event is called: "Default VBEvent". If you register this event then the VBX emulation layer will send a WM_VBXEVENT message with the registered notification code of the default event.

For example if you were to register this event as follows:

UINT VBN_DEFAULTEVENT = AfxRegisterVBEvent("Default VBEvent");

Then the VBX emulation layer will send a WM_VBXEVENT message with the VBN_DEFAULTEVENT notification code. You can still unpack the event information to find what the "true" event was that generated this message. The nEventIndex member of the AFX_VBXEVENTPARAMS structure will have the id of the "true" event that caused the notification to be sent. See MFC TechNotes 24 and 27 for more details on the WM_VBXEVENT message and the AFX_VBXEVENTPARAMS structure.

REFERENCES

MFC TechNote #24 describes private MFC messages including the WM_VBXEVENT message.

MFC TechNote #27 describes MFC's emulation support for VBX controls including how events are packed and sent as parameters.


Additional reference words: 1.00 1.50 2.00 2.50 kbinf ctl vb
KBCategory: kbprg
KBSubcategory: MfcVBX
Keywords : kb16bitonly
Technology : kbMfc


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: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.