473,500 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with C# COM Interop, creating a DCOM server

I am in desperate need to get help in answering some questions in
regards to building a DCOM Server using C#.

I need to create a DCOM server using C#.NET, I realise that you first
need to create the managed code, attach interfaces and use the CCW
command line tool to add a COM wrapper to the assembly.

The server will be communicating with a DCOM client which I didn't
write, but I have all the documentation on what interfaces and methods
it uses.

Please keep in mind I have never written a COM object before.

The questions I have are as follows:

1. What extra do I need to do to make the COM object into a DCOM object?

2. Do I need to worry about IInterface or IDispatch? Or is this all
done by the CCW Wrapper?

3. How do I generate the GUID for each interface? And do I need to
worry about the QueryInterface Interface which the client uses to find
out which interfaces are available?

4. I found a basic COM Interop Server in C#, which just returns the
name of a person to the COM client as shown below. My guess is that I
just create the interfaces on the Server side COM object as the
documentation requests and then write my own code inside?

A DCOM Client and Server example would also be great if anyone has one
written in .NET (Any language would be fine, but prefer C# or VB.NET)
CODE:
-------------------------

using System;
using System.Runtime.InteropServices;
namespace CSharpServer
{
// Since the .NET Framework interface and coclass have to behave as
// COM objects, we have to give them guids.
[Guid("DBE0E8C4-1C61-41f3-B6Â* A4-4E2F353D3D05"
public interface IManagedInterface
{
int PrintHi(string name);
}

[Guid("C6659361-1625-4746-93Â* 1C-36014B146679"
public class InterfaceImplementation : IManagedInterface
{
public int PrintHi(string name)
{
Console.WriteLine("Hello, {0}!", name);
return 33;
}
}
}
Jul 21 '05 #1
0 2316

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

Similar topics

5
5114
by: Kedar Agarkar | last post by:
: This is general query seeking opinions about COM+ Development wherein Server is developed in C# and Client accessing that across machines is also C#. Wish to seek experienced words on...
0
442
by: David Dolheguy | last post by:
I am in desperate need to get help in answering some questions in regards to building a DCOM Server using C#. I need to create a DCOM server using C#.NET, I realise that you first need to create...
3
16242
by: Harish | last post by:
I am buiding an application in ASP.Net 2.0 with C#. After installing corel wordperfect i am adding the reference into the application. Afetr adding reference interop.wordperfect.dll is added to the...
1
1273
by: akshar108 via DotNetMonster.com | last post by:
I m developing a application for word count using interop office com component but it is running nicely in my server 2000 and i also check in local 2003 server and give all permission to com...
0
7182
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,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
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
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4923
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
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.