BUG: setBorderWidth(..,DhUnits.PERCENT) Causes ComFailExceptionID: Q196576
|
When you call setBorderWidth() with DhUnits.PERCENT, the following exception occurs:
com.ms.com.ComFailException: (0x80020009) Exception occurred.
DhUnits.PERCENT is not a valid unit in border-width specifications. The setBorderWidth() method should not accept a value of DhUnits.PERCENT.
Do not call setBorderWidth() by passing DhUnits.PERCENT because DhUnits.PERCENT is not a valid parameter.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
setBorderWidth passes the DhUnits parameter to the peer class without first
verifying whether it is valid. This causes the peer to generate a
ComFailException. A better implementation of setBorderWidth() is to ignore
invalid parameters or throw a setBorderWidth() exception.
import com.ms.wfc.html.*;
import com.ms.wfc.core.*;
import com.ms.wfc.ui.*;
public class Class1 extends DhDocument
{
public Class1()
{
initForm();
}
private void initForm()
{
}
protected void onDocumentLoad(Object sender, Event e)
{
DhTable table=new DhTable();
add(table);
table.setBorderWidth(DhBorders.ALL,4,DhUnits.PERCENT);
}
}
<HTML>
<BODY>
<hr>
<OBJECT classid="java:com.ms.wfc.html.DhModule"
height=0 width=0 ... VIEWASTEXT>
<PARAM NAME=__CODECLASS VALUE=Class1>
<PARAM NAME=CABBASE VALUE=Project1.CAB>
</OBJECT>
<!-- Insert HTML here -->
</BODY>
</HTML>
com.ms.com.ComFailException: (0x80020009) Exception occurred.
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java,
please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/
© Microsoft Corporation 1998, All Rights Reserved.
Contributions by Derek Jamison, Microsoft Corporation
Additional query words:
Keywords : kbVJ600bug kbInetDev kbwfchtml
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 8, 1999