The information in this article applies to:
SUMMARYThe MSDN sample that demonstrates how to create a composite WFC control using Visual J++ is incorrect. The MessageBox that is added to the code in the final "Debugging the Control" step is not displayed. MORE INFORMATIONTo find the article in MSDN, follow this path on the Contents tab: MSDN Library Visual Studio 6.0\Visual J++ Documentation\Using Visual J++\Programmer's Guide\WFC Control Development\Creating Composite WFC ControlsThe article takes you through the steps to create a composite WFC control. When complete, the control seems to work correctly in the designer and at runtime, but the MessageBox in the final "Debugging the Control" step is never displayed (events are not caught as expected). NOTE: In the following text, onCheckChanged is the method you add to the composite control and onCheckedChanged is the EventHandler already in the CheckBox control. The problem is that the onCheckChanged( ) method is never called, so you need to do a bit of extra work that is not included in the MSDN sample. You need to add an EventHandler for the CheckBox's onCheckedChanged( ) event by adding the following line after the call to initForm( ) in the composite control's constructor:
Unfortunately, the composite control's onCheckChanged( ) method does not fit the required EventHandler prototype. Following is the modified onCheckChanged( ) method:
The setChecked( ) method in the composite control also has a reference to onCheckChanged( ) that you need to change. Following is the corrected setChecked( ) method:
Now the sample should work as described in the article.© Microsoft Corporation 1999, All Rights Reserved. Additional query words: Composite Control WFC Multicast Delegate
Keywords : kbdocerr kbCtrlCreate kbJava kbVJ600 kbGrpJava |
Last Reviewed: March 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |