RAD Studio for Microsoft .NET |  |

Using DrInterop

The drinterop command line tool examines an assembly and produces a set of diagnostic messages that help you prepare the assembly for use with COM/Interop.

The drinterop tool is located in the bin directory of the product installation. It is invoked by typing

Copy Code

    drinterop assembly

Message | Cause
Assembly ComVisible attribute is true when it should be false. | The [assembly:ComVisible(bool)] attribute is set to true, or is not present. Assemblies should be hidden from COM to reduce registry clutter. Set the ComVisible attribute to false, and selectively expose classes and interfaces.
Assembly, class, or interface is exposed to COM but does not contain the Guid attribute. | The assembly, class, or interface has the ComVisible attribute set to true but does not contain a Guid attribute.
A type library should be generated and registered for assembly. | This message is generated when a type library is not found in the same directory as the assembly.
Assembly does not contain the TypeLibVersion attribute. | The assembly does not contain the [assembly: TypeLibVersion(x,y)] attribute. By default type library version numbers are generated using only the first two numbers of the assembly version. Using the TypeLibVersion attribute can help avoid problems where two assemblies would produce the same type library because the first two digits of their version number are the same.
Reduce registry size by adding attribute [ClassInterface(ClassInterfaceType.None)] to class. | The class does not contain the ClassInterface attribute. By default, each class will cause the creation of a corresponding interface with the class name prefixed with an underscore character. This interface has no methods associated with it. You can reduce registry size and clutter by putting the [ClassInterface(ClassInterfaceType.None)] attribute on the class.

Note: The drinterop
tool will not print any messages if it does not find any of the above conditions.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!