473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Calling Regsvr32 on a .NET Assembly

Fairly simple question !!!

The title says it all. But here is a further description -

I have a software that expects a COM DLL. Due to certain requirements we
have to create a .NET assembly instead.

I know we can do RegAsm, but the way we have to "load" this assembly into
another program is that ... the other program calls DllRegisterServer on it
directly - (regsvr32 equivalent).

So my question is - How can we fake a .NET assembly so that regsvr32.exe
thinks it is indeed a COM DLL and we use it VIA RegSvr32 and not RegAsm.exe.

Regards,

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik


Nov 16 '05 #1
2 4741
If you have access to MC++ you could always write a small DLL that uses the
RegistrationServices class in its DllRegisterServer method, delegating to
the runtime to register the actual assembly.

And out of interest, how does it determine the CLSID of the object to
instantiate from the DLL you give it?

--
John Wood
Blog: http://spaces.msn.com/members/johnwood

"Sahil Malik" <co*****************@nospam.com> wrote in message
news:ur****************@TK2MSFTNGP14.phx.gbl...
Fairly simple question !!!

The title says it all. But here is a further description -

I have a software that expects a COM DLL. Due to certain requirements we
have to create a .NET assembly instead.

I know we can do RegAsm, but the way we have to "load" this assembly into
another program is that ... the other program calls DllRegisterServer on it directly - (regsvr32 equivalent).

So my question is - How can we fake a .NET assembly so that regsvr32.exe
thinks it is indeed a COM DLL and we use it VIA RegSvr32 and not RegAsm.exe.
Regards,

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik

Nov 16 '05 #2
John,

That was my recommended solution too, but I was wondering if we could keep
it withing C#.

To answer your question - It calls does regsvr32's job of registering it, -
then it is like any other com registered dll.

- Sahil Malik
You can reach me thru my blog -
http://www.dotnetjunkies.com/weblog/sahilmalik

"John Wood" <john.wood@priorganize_nospam__.com> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
If you have access to MC++ you could always write a small DLL that uses
the
RegistrationServices class in its DllRegisterServer method, delegating to
the runtime to register the actual assembly.

And out of interest, how does it determine the CLSID of the object to
instantiate from the DLL you give it?

--
John Wood
Blog: http://spaces.msn.com/members/johnwood

"Sahil Malik" <co*****************@nospam.com> wrote in message
news:ur****************@TK2MSFTNGP14.phx.gbl...
Fairly simple question !!!

The title says it all. But here is a further description -

I have a software that expects a COM DLL. Due to certain requirements we
have to create a .NET assembly instead.

I know we can do RegAsm, but the way we have to "load" this assembly into
another program is that ... the other program calls DllRegisterServer on

it
directly - (regsvr32 equivalent).

So my question is - How can we fake a .NET assembly so that regsvr32.exe
thinks it is indeed a COM DLL and we use it VIA RegSvr32 and not

RegAsm.exe.

Regards,

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin Huseby Karlsen | last post by:
I made a dll in c++ to do some calculations, and i call it from vba ( for excel XP, also tried it fro access and excel 2000) Problem is that when i copy the dll to another PC and run the same vba...
5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
2
by: Grant Merwitz | last post by:
Hi We have just bought a product what has a classic ASP front end that uses 2 assemblies. These are registered with the following command: regsvr32 Repository.dll /s regsvr32 Dynu.dll /s ...
2
by: Richard B | last post by:
I added a .NET dll as a reference to my new .NET dll. When I went to build, I received error "Unable to emit assembly: Referenced assembly 'CrystalReport' does not have a strong name". ...
2
by: Genady Beryozkin | last post by:
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....
11
by: =?Utf-8?B?Um9iS2lubmV5MQ==?= | last post by:
Hello, We are testing and tweaking some of our software to run on Vista, but it turns out that we are having problems with one of our programs. Here is our code: // attempt an experiment to...
1
by: DR | last post by:
when i reference a com object by regsvr32 it then find it in the COM tab, it works ok. but when i reference a com object by referencing the .dll file i get this error in my C# application: ...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
8
by: Derek Hart | last post by:
I am unclear about what all the requirements are to call a simple vb.net application, installed in the GAC, from COM (such as writing vba in Word to call the dotnet dll). I believe I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.