FIX: DhRow.removeAll() Causes a com.ms.com.ComFailException

SYMPTOMS

When you call DhRow.removeAll() the following exception occurs:
com.ms.com.ComFailException: Unknown error(0x800a0258)
at com/ms/wfc/html/om/IHTMLElement.setOuterHTML (IHTMLElement.java)
at com/ms/wfc/html/DhElementArray.removeInternal (DhForm.java)
at com/ms/wfc/html/DhElementArray.remove (DhForm.java)
at com/ms/wfc/html/DhBaseContainer.removeChildren (DhBaseContainer.java)
at com/ms/wfc/html/DhBaseContainer.removeAll (DhBaseContainer.java)

RESOLUTION

To work around this problem, remove each cell in the row individually using
the DhRow.remove() method. For example, do the following to remove all of the cells from a DhRow element called row1:
DhCell[] cells = row1.getCells();if (cells != null) {   for (int i = 0; i < cells.length; ++i)   row1.remove(cells[i]);}

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Visual J++, select New Project from the File menu.
  2. In the New Project dialog box, click the New tab.
  3. In the Visual J++ Projects tree, click Web Pages.
  4. Click Code-Behind HTML.
  5. Click Open to create the project.
  6. Modify Class1.java as follows:
    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)   {      this.add(new DhHorizontalRule());      DhTable table=new DhTable();      add(table);      DhRow row1,row2;      DhCell cell;      row1=new DhRow();      table.add(row1);      cell=new DhCell("Cell1");      row1.add(cell);      cell=new DhCell("Cell2");      row1.add(cell);      cell=new DhCell("Cell3");      row1.add(cell);      row2=new DhRow();      table.add(row2);      cell=new DhCell("Cell3");      row2.add(cell);      cell=new DhCell("Cell4");      row2.add(cell);      cell=new DhCell("Cell5");      row2.add(cell);      row1.removeAll();// to workaround the problem, comment out the above call to removeAll// and uncomment the following lines://    DhCell[] cells = row1.getCells();//    if (cells != null) {//       for (int i = 0; i < cells.length; ++i)//          row1.remove(cells[i]);//    }   }}
  7. Modify Page1.html as follows:
    <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>
  8. Run the project.
RESULT: The following exception error occurs:
com.ms.com.ComFailException: Unknown error(0x800a0258)

REFERENCES

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:
Propiedades

Id. de artículo: 194898 - Última revisión: 02/14/2017 - Revisión: 1

Microsoft Visual J++ 6.0 Edición estándar

Comentarios