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 / Languages / Managed C++ / August 2006

Tip: Looking for answers? Try searching our database.

registering mixed mode DLLs (regsvr32)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Genady Beryozkin - 16 Aug 2006 14:54 GMT
I have a COM dll that defines a COM object.
I used to register it either during link or using regsvr32.

Now I have compiled one of the C++ files in the DLL with /clr so now I have
a mixed DLL.
The problem is that the DLL registration no longer works.
Regsvr32 succeeds but the GUIDs of the COM objects no longer present in the
registry
and when somebody tries to CreateInstance of them, I get an error "Class Not
Registered".

Is there any magic that makes it possible to register such DLL?

Thanks in advance,
Genady
Marcus Heege - 17 Aug 2006 18:12 GMT
Yes, that's a pity in VS.NET. If you have a project that produces an
assembly, and use the linker setting to register the output, they will use
RegAsm to register the .NET types instead of RegSvr32.
You should avoid this setting and use a custom build step instead.

Marcus

>I have a COM dll that defines a COM object.
> I used to register it either during link or using regsvr32.
[quoted text clipped - 11 lines]
> Thanks in advance,
> Genady
Genady Beryozkin - 20 Aug 2006 13:10 GMT
That wasn't the problem. I tried to manually register the DLL with
regsvr32 and it didn't work either.

I found two things that when combined did help:
1. define the _ATL_MIXED macro
2. Initialize the CComModule global in a managed code section. The original
problem was that the InitInstance() was not called (for a reason that I
don't fully understand). After placing the CComModule initialization in a
managed section the InitInstance is called
correctly and the registration proceeds as expected.

Maybe it's a know problem and I'm only treating the symptoms, so if anybody
has a clue what it's all about - please let me know. I know we're using old
COM classes. Would using
ATL8.0 help?

Genady

> Yes, that's a pity in VS.NET. If you have a project that produces an
> assembly, and use the linker setting to register the output, they will use
[quoted text clipped - 18 lines]
>> Thanks in advance,
>> Genady

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.