BUG: OLE_COLOR Is Not Imported as a System.Drawing.Color (327105)



The information in this article applies to:

  • Microsoft .NET Framework 1.0
  • Microsoft Windows .NET Framework 1.1

This article was previously published under Q327105

SYMPTOMS

If you use Type Library Importer (Tlbimp.exe) to import a Component Object Model (COM) component into the Microsoft .NET Framework, and then there is an argument of the OLE_COLOR data type in one of the methods of the COM component, the OLE_COLOR argument is imported into the UInt32 value type instead of into the System.Drawing.Color namespace.

RESOLUTION

Use the following method to convert the color value from UInt32 to the System.Drawing.Color namespace.
public static Color System.Drawing.ColorTranslator.FromOle(int olecolor)

STATUS

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

MORE INFORMATION

You can use the either of the following tools to translate System.Drawing.Color to OLE_COLOR:
  • Tlbexp.exe
  • Regasm.exe

Modification Type:MinorLast Reviewed:5/28/2003
Keywords:kbbug kbCOMInterop KB327105 kbAudDeveloper