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

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 2294

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

Similar topics

5
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
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
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
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
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: 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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.