473,734 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3751
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.co m

"Ezmeralda" <ez*******@gmx. dewrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.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
2652
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 interesting, is if I change the name of ErrorType to Error the issue goes away. Has anyone else ran into this issue? Do you have a solution? The pertanant part of the schema: <snip>
1
4116
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. The below explanation is lengthy, but well worth the read. If you can help me, I'd gladly share this code which has greatly helped my development of extensible applications.
9
4646
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
3901
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 type library. for example: public interface IA {
3
3146
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 Base Class Library for Serial Device Communication" but I'm new with VC# and need some basic rules because I have a lot of compilation errors. Where should I create my inherited class? Thank you
3
8214
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 event must use property syntax" Here is a code sample: public interface IFoo
4
9325
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) Uses port 80, skips firewall The server computer doesn't have a IIS or web server
21
13838
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 by Sets. - ICollection cannot decide containment - IList promises indexability by the natural numbers, which is not achievable (since i hash elements, not sort them). - IDictionary is definatly not setlike. Although I can, of course, define...
4
1523
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 2005 database and was thinking of using Service Broker but i dont even know where to start, I have thought of using remoting but I dont think there is a way of the client being notified instantly, which is key. Any suggestions greatly appreciated.
7
1799
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. Based on a couple design patterns I have built a sample app that seems to be a pretty decent model (I think). Is this solution a pretty decent implementation of a process where an x number of objects need to be notified when an event is triggered...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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 we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.