Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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 .
Posted
Updated 30-Apr-14 3:07am
v2
Comments
Kornfeld Eliyahu Peter 30-Apr-14 8:21am    
Beware! Member looking at you! :) :) :)
Argonia 30-Apr-14 8:26am    
I am scared, but I am fighting with this problem for quite a while and i don't have any choice :(
Kornfeld Eliyahu Peter 30-Apr-14 8:27am    
"I am scared" - You should not! Face your doom with dignity...
Argonia 30-Apr-14 8:31am    
I ashamed my family! After this problem is solved I should commit sempuku. :P
Two rabbits with one stone
1)Maybe I wont face the Member
2)I wont deal with this cr@p again :) The project is not mine to deal with in the first place. I just got the short straw (again):((
Kornfeld Eliyahu Peter 30-Apr-14 8:52am    
But seriously - is it possible that CSharpComponent references Kernel with Local Copy true?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900