B
bz
Hi,
I need to write a COM component in C# (VS 2005)
I created the C# class library project, marked it "Make Assemble COM
visible"
I set the assembly to be signed with a key file.
The class contains a single method, as below:
namespace MyPlugin
{
public class MyClass
{
public bool Process(object session)
{
bool retVal = false;
try
{
// some processing here
retVal = true;
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex.Message);
}
return retVal;
}
}
}
I built the project and registered it with
c:\>regasm /tlb:mylib.tlb mylib.dll
Microsoft (R) .NET Framework Assembly Registration Utility
2.0.50727.1433
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
Types registered successfully
Assembly exported to (...)MyLib.tlb', and the type library was
registered success
fully
c:\>gacutil /i mylib.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version
2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly successfully added to the cache
The message seems ok.
Still, in object browsert in VB6 or Access or other COM-enabled, I can
browse my class (by browsing the TLB) and I see only three methods
Equals, GetHashCode and GetType and a property ToString, but I cannot
see my method.
What am I doing wrong?
Thanks
I need to write a COM component in C# (VS 2005)
I created the C# class library project, marked it "Make Assemble COM
visible"
I set the assembly to be signed with a key file.
The class contains a single method, as below:
namespace MyPlugin
{
public class MyClass
{
public bool Process(object session)
{
bool retVal = false;
try
{
// some processing here
retVal = true;
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex.Message);
}
return retVal;
}
}
}
I built the project and registered it with
c:\>regasm /tlb:mylib.tlb mylib.dll
Microsoft (R) .NET Framework Assembly Registration Utility
2.0.50727.1433
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
Types registered successfully
Assembly exported to (...)MyLib.tlb', and the type library was
registered success
fully
c:\>gacutil /i mylib.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version
2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly successfully added to the cache
The message seems ok.
Still, in object browsert in VB6 or Access or other COM-enabled, I can
browse my class (by browsing the TLB) and I see only three methods
Equals, GetHashCode and GetType and a property ToString, but I cannot
see my method.
What am I doing wrong?
Thanks