Hello, I have a problem with COM (Bob help me not again).
This time I have a c# dll registered though COM(lets Call it MyCSharpComponent.dll) which has a reference to another dll(MyKernel.dll)
The MyKernel.dll has few basic classes used by the MyCSharpComponent.dll. They mainly represent color, border color and stuff like that of some element.
[ComVisible(true)]
[Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ICSharpComponentControlEvents
{
}
//definition of the interface
[ComVisible(true)]
[Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface ICSharpComponentControl
{
}
//definition of the class
[ClassInterface(ClassInterfaceType.None)]
[Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]
[ProgId("<The progId goes here>")]
[ComVisible(true)]
[ComSourceInterfaces(typeof(ICSharpComponentControlEvents))]
public partial class CSharpComponentControl: ICSharpComponentControl
{
}
The MyCSharpComponent.dll is registered though RegAsm with following command line:
...\RegAsm.exe MyCSharpComponent.dll /codebase /tlb
I checked the Ole viewer and indeed the component are present.
I have application written in vc++ calling that registered MyCSharpComponent.dll.
Everything is good when i start the application with the two dlls present in the same folder.
But if I start the vc++ application alone with no MyCSharpComponent.dll or MyKernel.dll in the folder in the place where these variables of these classes should be I get disabled element with namespace string for value including the name of the current class.
According my boss COM should add these classes from the referenced MyKernel.dll to the .tlb file of MyCSharpComponent.dll and the vc++ application should be able to use them without the dll present in the folder and with no COM registration for MyKernel.dll, but i never found anything supporting his theory and he left me alone to deal with it (Figures).
If anyone has ideas what should I do, feel free to write it down.
Any help will be appreciated.
Thank you in advance.
Note:All guids and names are changed .