Re: Creating COM object written in C#
- From: jdyer521@xxxxxxxxx
- Date: Tue, 5 Feb 2008 13:20:03 -0800 (PST)
Thanks for your reply.
- Yes, I did register the assembly on the machine using regasm. I am
able to instantiate the COM object using C++. I am also able to see it
in the registry.
- Your question about where the assembly was located could have been a
problem. I am using an ASP page that has JavaScript to instantiate the
COM object. The ASP page is: http://localhost/MyDirectory/test.asp.
Just to make sure that wasn't the problem, I copied the DLL to the
same directory where the virtual directory was: c:\inetpub\wwwroot
\MyDirectory.
- It is not in the Global Assembly Cache. Is this a problem? I don't
think this could be causing the problem because when you say:
var blah = new ActiveXObject("progid")
in JavaScript, I think it goes to the registry to look up the progid.
Do you think I need to work on getting the assembly in the GAC?
- You asked how the COM object is defined. It is implementing an
interface like this:
namespace MyNameSpace
{
[Guid("(guid here)"]
public interface MyClass_Interface
{
// method declarations
}
[Guid("guid here"),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface MyClass_Events
{
// nothing in here
}
[Guid("guid here"),
[ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(MyClass_Interface))]
public class MyClass: MyClass_Interface
{
// private members variables
// method definitions
}
}
I am compiling this in Visual Studio 2005 and then running regasm. I
verified that the COM object was in the registry. I am using the
progid as specified in the registry when I create the ActiveXObject in
JavaScript.
Thanks again for your reply.
.
- Follow-Ups:
- Re: Creating COM object written in C#
- From: Willy Denoyette [MVP]
- Re: Creating COM object written in C#
- References:
- Creating COM object written in C#
- From: jdyer521
- Re: Creating COM object written in C#
- From: Nicholas Paldino [.NET/C# MVP]
- Creating COM object written in C#
- Prev by Date: Re: bytes To Hex
- Next by Date: Re: Get/Set vs Public Variables
- Previous by thread: Re: Creating COM object written in C#
- Next by thread: Re: Creating COM object written in C#
- Index(es):
Relevant Pages
|