Re: Create a COM Object with C#?

From: Craig (WeeksAtSprynetDotCom)
Date: 02/23/05


Date: Wed, 23 Feb 2005 17:02:09 -0600

Thanks, that definitely got me going in the right direction. I am trying to
build the "COM Interop Part 2 Sample" from:

http://msdn.microsoft.com/library/en-us/csref/html/vcwlkcominteroppart2cservertutorial.asp

Actually, building it and registering it with regasm works fine. I can add
a reference to this COM server in the VB 6.0 IDE. From the VB Object
Browser I can see the PrintHi() method in the IManagedInterface class. But
this line of VB 6.0 code:

    Set myObj = New CSharpServer.InterfaceImplementation

gets this error message during the VB compile:

    "Run-time error 80070002. File or assembly name CSharpServer, or one of
its dependencies was not found."

Surely I am almost there. What's the last step?

Craig

"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:%23G9maXeGFHA.2412@TK2MSFTNGP14.phx.gbl...
>
> >In fact, I cannot see any methods or properties. What am I missing here?
>
> See if this helps: http://www.dotnetinterop.com/faq/?q=ClassInterface
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.



Relevant Pages

  • Re: Cannot unregister assembly
    ... I forgot to say that I am registering using the following code: ... public static void UnregisterFunction ... > COM interop" option was checked. ... > Now when I try to compile my project I get the message: ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: Scripting Error/Runtime Error
    ... I tried registering all the DLLs mentioned in kb article ... That article does not apply to IE7. ... Reference error message: The operation completed successfully." ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Eroor 0x80244010
    ... I have same error message. ... I have registered all MSXML files. ... > This issue can be resolved by registering the MSXML files as they could be ... > Try accessing the Windows Update Site again and see if your issue gets ...
    (microsoft.public.windowsupdate)
  • Re: App.path - equivalent - in an interop DLL
    ... > I want this to work with COM interop too, ... > .NET DLL for use with interop is registering it into the GAC with ... compatibility (so you can use early binding in your VB6 project). ... > back to its original path? ...
    (microsoft.public.dotnet.framework)
  • vb.net Automation Issues - COM Interop
    ... registering it for com interop and then ... The error I am receiving is happening in VB6 when I go to compile the ... and the project is registered for COM Interop. ... Public Class ClientInterface ...
    (microsoft.public.dotnet.languages.vb)