Re: Creating COM object written in C#

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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.

.



Relevant Pages

  • Re: Creating COM object written in C#
    ... I am using an ASP page that has JavaScript to instantiate the ... I think it goes to the registry to look up the progid. ... public interface MyClass_Interface ... I am compiling this in Visual Studio 2005 and then running regasm. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Runtime error
    ... the system registry has no ... If the attempt to instantiate is the result of a CreateObject or GetObject ... Many third-party applications will create an add-in and place it in the ... Office\Startup folder or use a COM add-in to integrate their ...
    (microsoft.public.word.application.errors)
  • Re: ClassFactory cannot supply requested class
    ... I have been unable to reproduce the error on my machine. ... to instantiate a COM component. ... Anytime there is a 'COM' issue the registry is an active player, ... logging, error trapping, or other debugging tools to isolate and identify ...
    (microsoft.public.vb.general.discussion)
  • Instantiating Remote Objects through COM
    ... I want to instantiate a component in Machine B from Machine A. i.e The ... orginal component is registered in Machine A and i want to create a object of ... I have made an entry in teh registry of machine B with the same class ID ... Deepak ...
    (microsoft.public.win32.programmer.ole)
  • Instantiating Remote Objects through COM
    ... I want to instantiate a component in Machine B from Machine A. i.e The ... orginal component is registered in Machine A and i want to create a object of ... I have made an entry in teh registry of machine B with the same class ID ... Deepak ...
    (microsoft.public.win32.programmer.ole)