Support Statement: Dealing with Library/Class Name Clash
In some situations, a COM library name clashes with one of the class names. Â This is more common for COM controls.
This can cause build errors in the generated code and in the stub code, in particular. Â
The work around is to add a "netName" attribute to the coclass definition.
For example, consider this control:
The translator generates a stub for SSSPlitter control that does not compile. This is because there is a "name clash" between the class name and the namespace: namespace SSSplitter { // .... public class SSSplitter : System.Windows.Forms.Control { public SSSplitter.Panes Panes // This line throws a compiler error, C# assume SSSPlitter is the name of the class, not the namespace { set { } get { return null; } } } }
The script below shows how to add a "netName" attribute to the coclass definition.
<DescriptionFile> <library id="IGSPLITTER.OCX" name="SSSplitter" uuid="14ACBB92-9C4A-4C45-AFD2-7AE60E71E5B3" netVersion="4.0" source="IGSPLITTER.OCX" location="%library%\Interop.SSSplitter.dll" axLocation="%library%\AxInterop.SSSplitter.dll" type="ActiveX" > ... <coclass id="SSSplitter" uuid="60051AC3-70FA-4592-AAAE-6F1093E3E7F2" migStatus="ActiveX" migName="AxSSSplitter.AxSSSplitter" netName="SSSplitterNew" >