Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / January 2005

Tip: Looking for answers? Try searching our database.

2 .NET classes in a COM Assembly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
YuriL - 19 Jan 2005 21:17 GMT
Hi,
I have a .NET assembly that I am trying to register as a COM dll.  The
problem that I am faced with, is that this assembly has two classes, one of
which is a Windows Form.  As of now, I have a ComRegisterFunction in both of
the classes, but I am getting a "DLLRegisterServer entry point was not found"
error when I try to register the dll as a COM server.  Can anyone tell me how
to go about resolving this issue?
Thanks in advance!
Yuri
Mattias Sj?gren - 19 Jan 2005 21:28 GMT
>but I am getting a "DLLRegisterServer entry point was not found"
>error when I try to register the dll as a COM server.  Can anyone tell me how
>to go about resolving this issue?

Which registration tool are you using? Assemblies generally don't
export a DllRegisterServer entry point, so you can't use Regsvr32 or
similar tools. Instead use a tool like Regasm.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

YuriL - 19 Jan 2005 22:17 GMT
when i only had one class in the assembly, I was able to register it by
including the [ComREgisterFunction] attribute before the class definition.  I
belive I used Regsvr32 and it worked then - i'll have to double check.  In
the mean time, I thought Regasm only adds things to the GAC - can I use it to
add my assembly to the registry - for use by COM?  Also, not to get off my
original question, how do I do this for more than one class in the assembly?
Thanks,
Yuri

"Mattias Sjögren" wrote:

> >but I am getting a "DLLRegisterServer entry point was not found"
> >error when I try to register the dll as a COM server.  Can anyone tell me how
[quoted text clipped - 5 lines]
>
> Mattias
Mattias Sj?gren - 19 Jan 2005 22:49 GMT
>I thought Regasm only adds things to the GAC

It doesn't, you must be thinking of Gacutil.

>can I use it to add my assembly to the registry - for use by COM?

Yes, registering assebmlies with COM is all that Regasm does.

>Also, not to get off my
>original question, how do I do this for more than one class in the assembly?

The number of classes doesn't matter, you can include as many as you
like. I'm not sure if you can have multiple [ComRegisterFunction]
methods though, I've never tried that.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.