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

DLL Communication Interface: .NET class library <-> Win32-DLL

Hello,

I need to an TCP/IP Interface for communication with an embedded
device.
Since I have two different design ideas in mind, I am wondering
whether
you could give me some hints to decide:

Requirements:
- Interface should be used for company internal purposes/software but
also
as an interface for our customers -interface should be a DLL
- internally, the interface should only be used with C# Applications
- our customers want to use the interface with "native" C++, VB6, VBS,
C#, VB.NET, Labview, ...

Design 1:
- implement the interface as .NET class library in C#
- expose this .NET class library as COM dll
(whatever this means exactly...) so that it can be used by
C++, VB6, VBS, ...
- advantage: easy implementation of the interface in C#;
easy debugging
- disadvantage/open issue: what does it mean to expose the
interface as COM dll (esp. in terms of effort); does
exposing as COM dll really provide an interface for all
possible applications? how can this COM interface be used?

Design 2:
- implement the interface in C++ as standard Win32-dll
- provide a C# wrapper class (maybe compiled as .net class library)
mainly for internal purposes
- advantage: well-known win32-dll-interface -our customers
know how to use it and there are no tradeoffs
- disadvantage: complex socket programming in C++ required;
C# wrapper required; more complex software debugging

Which design would you prefer? Why? Could you give
me some decision guidance, please?!

Apr 3 '07 #1
1 3726
Personally, I would go with creating a COM component. You ^could^ do
the development in .NET and expose the item as a COM component, but for some
reason, it seems like it might almost be easier to do using Active Template
Library (ATL) as it has a number of classes that wrap Socket functionality.

If you have a majority of customers that are going to use the unmanaged
component, then I would recommend developing it using C++, as it should make
distribution easier. If you do the development in .NET and then expose it
as a COM object, you will have to distribute the framework, and that might
create a distribution scenario which is harder than you are looking for.

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

"Ezmeralda" <ez*******@gmx.dewrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
Hello,

I need to an TCP/IP Interface for communication with an embedded
device.
Since I have two different design ideas in mind, I am wondering
whether
you could give me some hints to decide:

Requirements:
- Interface should be used for company internal purposes/software but
also
as an interface for our customers -interface should be a DLL
- internally, the interface should only be used with C# Applications
- our customers want to use the interface with "native" C++, VB6, VBS,
C#, VB.NET, Labview, ...

Design 1:
- implement the interface as .NET class library in C#
- expose this .NET class library as COM dll
(whatever this means exactly...) so that it can be used by
C++, VB6, VBS, ...
- advantage: easy implementation of the interface in C#;
easy debugging
- disadvantage/open issue: what does it mean to expose the
interface as COM dll (esp. in terms of effort); does
exposing as COM dll really provide an interface for all
possible applications? how can this COM interface be used?

Design 2:
- implement the interface in C++ as standard Win32-dll
- provide a C# wrapper class (maybe compiled as .net class library)
mainly for internal purposes
- advantage: well-known win32-dll-interface -our customers
know how to use it and there are no tradeoffs
- disadvantage: complex socket programming in C++ required;
C# wrapper required; more complex software debugging

Which design would you prefer? Why? Could you give
me some decision guidance, please?!

Apr 3 '07 #2

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

Similar topics

0
by: Brett Selleck | last post by:
We have an issue where the JAXB generated classes are creating an interface which references itself. The Schema is valid, and I have not seen this ran into before. The code is below. What is...
1
by: MatthewRoberts | last post by:
Howdy All, I am having difficulty with two-way communication across AppDomains in an attempt to dynamically script applications. Everything works as expected, except when using ByRef parameters....
9
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
4
by: yoz | last post by:
Hi everyone, I wonder if you can shed some light on a problem I have. I am exporting a C# .Net set of classes to COM. All of it is exported properly but the interface inheritences are not in the...
3
by: carmen | last post by:
I'm working in an aplication for a Smart Device that need to "talk" with a printer continuosly through the serial port. I'm trying to use the John Hint's sample code "Use P/Invoke to develop a .NET...
3
by: Ohad Young | last post by:
Hi, I have an interface with an event. I'd like to explicitly implement the interface by a certain class. However, I received the following error: "An explicit interface implementation of an...
4
by: Christian Westerlund | last post by:
Hi! Does anyone know if it is possible for a client server communication easy in .NET with these requirements: The client always initiates the communication The server only answers (responds)...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
4
by: Benny | last post by:
Does anyone know of a good way of instant communication between two users using an ASP.NET interface? I have always been a WinForms guy and used sockets for communication. I have an SQL Server...
7
by: RSH | last post by:
I am working through some design patterns, and one recurring theme for me is the need to be able to communicate between objects while promoting encapsulation and loose coupling between them. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.