DOC: MSDN Sample - Creating Composite WFC ControlsID: Q216813
|
The 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.
To 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).
checkBox1.addOnCheckedChanged(new EventHandler(this.onCheckChanged));
Unfortunately, the composite control's onCheckChanged( ) method does not fit the required EventHandler prototype. Following is the modified onCheckChanged( ) method:
protected void onCheckChanged(Object source,Event event){
if(m_CheckChanged != null) m_CheckChanged.invoke(source, event);
}
The setChecked( ) method in the composite control also has a reference to onCheckChanged( ) that you need to change. Following is the corrected setChecked( ) method:
public void setChecked(boolean value){
checkBox1.setChecked(value);
onCheckChanged(this,Event.EMPTY);
enableControls(this, value);
}
Now the sample should work as described in the article.© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Joseph B. Hall, Microsoft Corporation
Additional query words: Composite Control WFC Multicast Delegate
Keywords : kbdocerr kbCtrlCreate kbJava kbVJ600 kbGrpJava
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: March 2, 1999