COM and registration question

O

oliderid

Hi,

I'm new to C# and the windows world (I used to work on Java and *nix
OSes). I'm using visual studio .net 2003.

I'm working on a add-in application to be used under a software. I was
able to settle the correct COM interface. Now I must register the
software in the windows registry.

Their documentation tells something:

"Your application must register itself as implementing the following
ID:
DFCE97AB-25ED-4335-BB00-FE5863F41DED. This desktop add-in ID is noted
in the
RimExtension.idl file. Microsoft Visual Studio creates an .rgs
registration file for
your project, as shown in the desktop sample application. To provide
the appropriate
registration information, you must add the following block to the .rgs
file:
'Implemented Categories'
{
{DFCE97AB-25ED-4335-BB00-FE5863F41DED}
}

"

I know what they means, to register my application as somewhat
connected to their own one. But I fail to see how it could be done.

I tried to find as much as information possible but it seems to be a
too wide topic. Is there anybody out there who could tell me precisly
the different things to do (not in details, but the tools to be used,
manipulations and so on).

Olivier
 
N

Nicholas Paldino [.NET/C# MVP]

Olivier,

I'm assuming you are implementing a COM interface on a .NET type. If
this is the case, you can create two static methods (one for registering,
one for unregistering) in your code that take a Type parameter. You can
then adorn these methods with the ComRegisterFunctionAttribute or
ComUnregisterFunctionAttribute attributes.

The code that is in these static methods will be run when your code is
registered and unregistered (through regasm). In these methods, you can
write the registry entries for the implemented category key for the
component in the registry.

Hope this helps.
 
O

oliderid

Nicholas said:
Olivier,

I'm assuming you are implementing a COM interface on a .NET type. If
this is the case, you can create two static methods (one for registering,
one for unregistering) in your code that take a Type parameter. You can
then adorn these methods with the ComRegisterFunctionAttribute or
ComUnregisterFunctionAttribute attributes.

The code that is in these static methods will be run when your code is
registered and unregistered (through regasm). In these methods, you can
write the registry entries for the implemented category key for the
component in the registry.

Hope this helps.

It helps. Thank you. It took me two days to understand how to implement
a COm interface and modify the COM accordingly. my biggest problem was
to find a good source of information about that particular topic over
the internet. it was like a puzzle but finally I found my way.

Olivier
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top