Problems with the COM-Wrapper Wizard

I recently got the following strange error-message during the execution of the COM-wrapper wizard:

“Method ‘Item’ in COM-object for class ‘Interfaces’ returned
error code 0x800A0009 (<unknown>) which means: <unknown>”

Debugging the wizard, I recognized that at the origin of this problem was an object that shouldn’t have been identified as a COM-object. Since it was a commercial product I couldn’t fix that behavior and the COM-wrapper wizard does unfortunately not allow me to choose the objects I like to wrap (and with that deselecting this particular object), I had to write a little workaround by modifying the wizard.

If once you have the same problem, just modify the “initiateClassCreation”-method of the SysCOMWrapperGen-class like this (I highlighted the modified code bold and italic):

   1:  if (inheritedInterface)
   2:  {
   3:     //REM : Correction in order to prevent pointing to an unexisting position
   4: if (inheritedInterface.ImpliedInterfaces().Count() > 0) 
   5:     {
   6:        if (inheritedInterface.ImpliedInterfaces().Item(1).Name() != 
   7:          ‘IDispatch’ && inheritedInterface.ImpliedInterfaces().Item(1).Name() != 
   8:          ‘IUnknown’)
   9:       {
  10:            inheritedInterface = 
  11:            inheritedInterface.ImpliedInterfaces().Item(1);
  12:            inheritString = ‘extends ‘ + Prefix + 
  13:            inheritedInterface.Name();
  14:       }
  15:     }
  16:  }

Comments (0)