473,431 Members | 1,608 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,431 software developers and data experts.

COM Interop - Localserver32 registry entries?

What registry entries do I need to make a class a localserver32?

Andrew
Nov 16 '05 #1
8 7130
Andrew,

You should not be setting these values yourself. Rather, you should let
the REGASM.exe tool do all of the work for you. You should check out part 2
of the COM interop tutorial, which details how to expose your classes in
..NET to COM clients. It is located at (watch for line wrap):

http://msdn.microsoft.com/library/de...ertutorial.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
What registry entries do I need to make a class a localserver32?

Andrew

Nov 16 '05 #2
Nicholas,

Regasm does not do what is necessary. Regasm sets up an inproc server for
the COM object. In my situation, I need the applicaiton to access the
process that is already running, which means it needs an out-of-process
server. Thus why I am looking for the keys for localserver32.

Do you know an option in regasm that will set up a localserver32? I could
not find one anywhere in the documentation.

Andrew

"Nicholas Paldino [.NET/C# MVP]" wrote:
Andrew,

You should not be setting these values yourself. Rather, you should let
the REGASM.exe tool do all of the work for you. You should check out part 2
of the COM interop tutorial, which details how to expose your classes in
..NET to COM clients. It is located at (watch for line wrap):

http://msdn.microsoft.com/library/de...ertutorial.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
What registry entries do I need to make a class a localserver32?

Andrew


Nov 16 '05 #3
Andrew,

If you need to access items that are already running, then setting it up
as an out of process server isn't going to be something you will be able to
do. Rather, you should register your instance on the running object table,
and have the other process access your component from there (either that, or
have it access it through COM+).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in message
news:E2**********************************@microsof t.com...
Nicholas,

Regasm does not do what is necessary. Regasm sets up an inproc server for
the COM object. In my situation, I need the applicaiton to access the
process that is already running, which means it needs an out-of-process
server. Thus why I am looking for the keys for localserver32.

Do you know an option in regasm that will set up a localserver32? I could
not find one anywhere in the documentation.

Andrew

"Nicholas Paldino [.NET/C# MVP]" wrote:
Andrew,

You should not be setting these values yourself. Rather, you should
let
the REGASM.exe tool do all of the work for you. You should check out
part 2
of the COM interop tutorial, which details how to expose your classes in
..NET to COM clients. It is located at (watch for line wrap):

http://msdn.microsoft.com/library/de...ertutorial.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in
message
news:20**********************************@microsof t.com...
> What registry entries do I need to make a class a localserver32?
>
> Andrew


Nov 16 '05 #4
Nicholas,

I found an article that sets up a class and interface as a DCOM server in
C#. I have this already set up in the code, I am just trying to find what
keys are necessary to be in the registry and pointing to what objects to get
it to work.

I have a DLL (MsgEvent) written in C# that I want to be the server. Then I
have a C# application that has a reference to this DLL, it instantiates a
copy of this class and establishes Event handlers for when the exposed
methods are called (the exposed methods wrap the incoming data, and spawn an
event to be processed). There is another process, written in unmanaged C++
that needs to call my COM class to get the data to me. If it looks for a
localserver in the registry and gets the interface of the one already
running, I should be able to send the data across, or that is what I am given
to understand. Which is why I want to set it up as a localserver32, though
this means manually (or via a script that I write) establishing the COM
object as a server.

I did not follow any of the idea for registering my process on the running
object table (is that registering the COM exposed class? and where is the
table? Im a bit out of my element here). Can unmanaged code call this
running object table?

Andrew

"Nicholas Paldino [.NET/C# MVP]" wrote:
Andrew,

If you need to access items that are already running, then setting it up
as an out of process server isn't going to be something you will be able to
do. Rather, you should register your instance on the running object table,
and have the other process access your component from there (either that, or
have it access it through COM+).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in message
news:E2**********************************@microsof t.com...
Nicholas,

Regasm does not do what is necessary. Regasm sets up an inproc server for
the COM object. In my situation, I need the applicaiton to access the
process that is already running, which means it needs an out-of-process
server. Thus why I am looking for the keys for localserver32.

Do you know an option in regasm that will set up a localserver32? I could
not find one anywhere in the documentation.

Andrew

"Nicholas Paldino [.NET/C# MVP]" wrote:
Andrew,

You should not be setting these values yourself. Rather, you should
let
the REGASM.exe tool do all of the work for you. You should check out
part 2
of the COM interop tutorial, which details how to expose your classes in
..NET to COM clients. It is located at (watch for line wrap):

http://msdn.microsoft.com/library/de...ertutorial.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in
message
news:20**********************************@microsof t.com...
> What registry entries do I need to make a class a localserver32?
>
> Andrew


Nov 16 '05 #5

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
Nicholas,

I found an article that sets up a class and interface as a DCOM server in
C#. I have this already set up in the code, I am just trying to find what
keys are necessary to be in the registry and pointing to what objects to
get
it to work.

I have a DLL (MsgEvent) written in C# that I want to be the server. Then
I
have a C# application that has a reference to this DLL, it instantiates a
copy of this class and establishes Event handlers for when the exposed
methods are called (the exposed methods wrap the incoming data, and spawn
an
event to be processed). There is another process, written in unmanaged
C++
that needs to call my COM class to get the data to me. If it looks for a
localserver in the registry and gets the interface of the one already
running, I should be able to send the data across, or that is what I am
given
to understand. Which is why I want to set it up as a localserver32,
though
this means manually (or via a script that I write) establishing the COM
object as a server.

I did not follow any of the idea for registering my process on the running
object table (is that registering the COM exposed class? and where is the
table? Im a bit out of my element here). Can unmanaged code call this
running object table?


You don't have to do this yourself, the CLR will register your classes
exposed as COM objects in the ROT.
Anyway, your scenario is not supported in .NET, you better derive your
classes from EnterpriseServices and host your objects in a COM+ server type
application.

Willy.
Nov 16 '05 #6
Willy,

I found the MSDN pages for COM+ Service components, etc. I will endeavor to
get this going as well. Do I have to inherit all of my classes off of
enterprise services, or just those that I need to gain access to from outside
the application? Can I keep these classes in the DLL where they are, and set
up said DLL as the COM+ Services app? Can unmanaged code call this COM+
Serviced object as it would any other com object?

Andrew

"Willy Denoyette [MVP]" wrote:
You don't have to do this yourself, the CLR will register your classes
exposed as COM objects in the ROT.
Anyway, your scenario is not supported in .NET, you better derive your
classes from EnterpriseServices and host your objects in a COM+ server type
application.

Willy.

Nov 16 '05 #7
Andrew,

Yes, only the public classes you want to expose as COM interfaces need to
extend the ServicedComponent class.
You can (should) keep your classes in a DLL and host that DLL in a server
type COM+ application.
All, unmanaged and managed 'COM clients' can access these components as if
they were implemented using non-managed code, you know in COM it's the
interface that rules not the implementation ;-).

Notes:
You have to set some attributes on your interfaces/classes in order to
customize the COM+ environment (server-type, security, pooling etc.).
It's a good idea to have your classes to implement an explicit interface,
that way you can simply refer to the assembly containing the interface
definition when building you managed clients. Unmanaged clients don't have
this requirement, they refer to a typelib generated when registering your
dll with regsvcs.exe.

Willy.

"Andrew S. Giles" <An**********@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
Willy,

I found the MSDN pages for COM+ Service components, etc. I will endeavor
to
get this going as well. Do I have to inherit all of my classes off of
enterprise services, or just those that I need to gain access to from
outside
the application? Can I keep these classes in the DLL where they are, and
set
up said DLL as the COM+ Services app? Can unmanaged code call this COM+
Serviced object as it would any other com object?

Andrew

"Willy Denoyette [MVP]" wrote:
You don't have to do this yourself, the CLR will register your classes
exposed as COM objects in the ROT.
Anyway, your scenario is not supported in .NET, you better derive your
classes from EnterpriseServices and host your objects in a COM+ server
type
application.

Willy.

Nov 16 '05 #8
Willy,

OK, so I have defined a class and inherited it off of ServicedComponent and
IMessages (my defined interface with 4 methods in it).

I have a C# application already built. Is adding a reference to this DLL a
good or bad thing. this C# applicaiton needs to get the data that is passed
as parameters in the methods of the interface. If I add the DLL here, does
that make this a server type COM+ applicaiton? Or should I make another
applicaiton somewhere to serve as this server?

Additionally, some legacy unmanaged C++ code will need to call this DLL (it
is the source of the data that I need to move from one application (the C++)
to the other (the C#). I presume this attaches just like this class was a
standard COM class, correct?

Im sorry for barraging you with these simple questions, but I am missing
something vital to getting this to work, and I just do not know what it is.

thanks again,

Andrew

"Willy Denoyette [MVP]" wrote:
Andrew,

Yes, only the public classes you want to expose as COM interfaces need to
extend the ServicedComponent class.
You can (should) keep your classes in a DLL and host that DLL in a server
type COM+ application.
All, unmanaged and managed 'COM clients' can access these components as if
they were implemented using non-managed code, you know in COM it's the
interface that rules not the implementation ;-).

Notes:
You have to set some attributes on your interfaces/classes in order to
customize the COM+ environment (server-type, security, pooling etc.).
It's a good idea to have your classes to implement an explicit interface,
that way you can simply refer to the assembly containing the interface
definition when building you managed clients. Unmanaged clients don't have
this requirement, they refer to a typelib generated when registering your
dll with regsvcs.exe.

Willy.

Nov 16 '05 #9

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

Similar topics

5
by: Kevin Flanagan | last post by:
This can be reproduced with VS.NET as follows. Create a new ATL project with default wizard settings (dll, attributed). To the 'module' attribute, add a specifier 'version = "1.10" ' alongside the...
0
by: keefah | last post by:
Hi, I'm writing a C# web app that uses Outlook to send email. I use a reference to the Microsoft Outlook 11.0 Object Library, but it's giving me problems. I tracked down some stuff on the Net...
4
by: krissy_kernan | last post by:
I am getting the following error when I try to run my code on the deployed server: "File or assembly name dllname.dll or one of its dependencies was not found." It is a VB6 app. that calls a .Net...
2
by: Andrew S. Giles | last post by:
OK, Ive run my head into this wall for too long. I need help. I am developing an applicaiton in C# to present a user with a GUI to specify a configurable list of machines that he wants to listen...
2
by: pagates | last post by:
Hello All, I have created a C# project that sets "Register for COM Interop" to true, and sets the ProgId and Guid attributes for the class. I then use this control inside VB6. This all works...
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
6
by: ANeelima | last post by:
I have a VB6 executable that references a .NET 2.0 dll. The .NET 2.0 dll project has 'Register for COM Interop' checked. Thus, compiling the dll will generate the .tlb file. This will allow early...
3
by: =?Utf-8?B?U0Q=?= | last post by:
Hi, I'm using the the MSDN sample "COM Interop Part 2 Sample" (CSharpServerWithCOMClient.sln). The C# COM component gets registered when the solution is built. Somehow the component doesn't get...
0
by: Henning | last post by:
This time I agree with Bill replying to a .Net related Q, even if it hurts :)) No need to kick on Bill everytime he is posting in this group. Fair is fair. /Henning "Kevin Provance"...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.