Creating a Com Component in VB.net 2005



Hello I was hoping you guys could help me out. I am new to .net and
specifically to VB.net. I have a simple calendar popup class library
dll that I want to Com enable. The program in essence works when I
create it as a standard windows application. So I think I am good on
the end. My trouble comes when I try and create it as a Com
Component.

I was told that I should do the following

1) Set the Assembly to Com-Visiable - Done

2) Register as a Com Interop - Done

3) Compile by importing System.Runtime.InteropServices - Done

4) Just to rule everything out I made all my individual class
attributes - Com Class True, Com-Visible True, and Serializable True
at every class level

5) I made all my individual functions and sub routines attributes
public and Com-Visible. I left the disp False

I then compiled the code and it compiled without issue.

I then did a Regasm.exe on my Vbcalendar.dll and that seemed to work
because I got back a valid registration message

So If I am doing everything right up to this point (which I am not
sure) then something must be going on after this point or I am missing
a step or an understanding of something

When I go into another 2005 .net project and want to add it as a
reference. I see it my Vbcalendar on the list of Com objects that I
can use.(It has the Vbcalendar, version number and the path to the
tlb. However when I try and add it to the list I get a message that
says

" a Reference to 'VbCalendar' could not be added. The Active X type
library 'c:\VbCal\VbCalendar\VbCalendar\bin\Debug\VbCalendar.tlb was
exported from a .net assembly and cannot be added as a reference.

Add a reference to the .net assembly instead. Can someone explain
what this means and how to do it??

I am writng this as a COM Component so that an old legacy application
that reads in registered dll's can find the the library(VbCalendar),
the classes, and the the members of those classes - Normally we used
Regserv32 to register the dll and it would show up in the legacy
system however in this case all my library shows up, my classes show
up, and my memebers show up. But when I try and close the dialog with
the information I provided it pretty much tells me that the executalbe
is not found on the machine

So given all that what do you guys think I might be doing
incorrectly? I think the failure for VS Studios to be able to add the
com component as a dll is causing the failure in the legacy system.
Is this assumption correct or could it be that because the dll itself
is registered with regasm instead of regsvr32 that might be causing
the problem. If that is the case then do I need to do something to
the com component to make it readable by the legacy system?

Sorry for all the questions but I really want to understand this and I
feel I am missing a piece because of the entire aspect of a .net
component versus the com component that is making me confussed.

Can you help?
Thanks
Josh

.



Relevant Pages

  • Re: Programmatically set reference to ActiveX dll
    ... programmatically to another ActiveX dll? ... Or should it be enough to compile the app with the reference set to the ... place it in a folder called Z:\HolySmokes, register it and VB's reference ...
    (microsoft.public.vb.general.discussion)
  • Re: Problem with interop.excel.dll
    ... Your project has a reference to the office 2003 version of Excel. ... Do I have to register this dll? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to call non-COM legacy dll from ASP.NET -OR- write COM wrapper in C#
    ... Have an old straight C style dll, need to call it from ASP.NET. ... normally works easily using DllImport but ASP.NET apparently doesn't let ... So I heard you can call COM dlls by just adding a reference. ... Used regasm.exe to register the dll w/ COM, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Making Type Library for normal Windows DLL (not a COM server)
    ... Is there a way we can register a type library for a normal ... add reference to it and the error message specifically says that " you ... typelib for a normal DLL. ... but I have no reason not to believe it. ...
    (microsoft.public.vc.language)
  • RE: Registering a custom DLL after deployment - advice?
    ... Register property to vsdraCOM - and leave the output as content ... I added the dll and the tlb and set the build action to ... publishing and invoke the .bat file. ... The custom dll is for the Access ADP. ...
    (microsoft.public.dotnet.languages.csharp)