473,385 Members | 2,180 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,385 software developers and data experts.

unmanaged code, COM interop vs. exported C functions

Hello,

I need to use a Win32 DLL for a C# client. Any advantage exposing my
functions as a COM object versus exported C functions? There will only be a
few function calls. Using COM seems like too much overhead for the little
interaction. I'm open to any insights or opinions.

Thanks in advance,

--
kevin aubuchon
www.aubuchon-design.com

Nov 16 '05 #1
3 1510
I don't see any advantage, but as you mention, there's all the disadvantage
(and overhead) of using COM interop.

--
Michael Giagnocavo
MVP
www.atrevido.net
"Kevin Aubuchon" <ke************@charter.net> wrote in message
news:FY*****************@fe07.lga...
Hello,

I need to use a Win32 DLL for a C# client. Any advantage exposing my
functions as a COM object versus exported C functions? There will only be
a
few function calls. Using COM seems like too much overhead for the little
interaction. I'm open to any insights or opinions.

Thanks in advance,

--
kevin aubuchon
www.aubuchon-design.com

Nov 16 '05 #2
If it's an existing DLL with only exported C functions, you don't have any
other option as to use PInvoke.

Willy.
"Kevin Aubuchon" <ke************@charter.net> wrote in message
news:FY*****************@fe07.lga...
Hello,

I need to use a Win32 DLL for a C# client. Any advantage exposing my
functions as a COM object versus exported C functions? There will only be
a
few function calls. Using COM seems like too much overhead for the little
interaction. I'm open to any insights or opinions.

Thanks in advance,

--
kevin aubuchon
www.aubuchon-design.com

Nov 16 '05 #3
I agree with Michael - export your public functions with the WINAPI
convention and consume them from the C# client with P/Invoke.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Kevin Aubuchon" <ke************@charter.net> wrote in message
news:FY*****************@fe07.lga...
Hello,

I need to use a Win32 DLL for a C# client. Any advantage exposing my
functions as a COM object versus exported C functions? There will only be
a
few function calls. Using COM seems like too much overhead for the little
interaction. I'm open to any insights or opinions.

Thanks in advance,

--
kevin aubuchon
www.aubuchon-design.com


Nov 16 '05 #4

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

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
1
by: Zapbbx | last post by:
I have a 3rd party application that can reference external dll's. The dll's have to be written in unmanaged code with an exported function I can reference and call. I would like it to call a C# dll...
3
by: Tommy Svensson \(InfoGrafix\) | last post by:
I've been instructed to work againt a huge unmanaged C++ API from a C# application. Now, the only way, as I've understood it, is to go the Managed Extensions for C++ way. This means I have to...
7
by: Tim | last post by:
When there is a need to pass some dynamic information between 2 managed assemblies, the "Dictionary object" in Generic form can be used as a method parameter to pass the information. The...
7
by: Greg Roberts | last post by:
Hi 1. Is there any way to access a static function in a class via the syntax ? e.g. in C# static extern void MyClass::MyFunc(); The compiler does not like the class reference ...
7
by: Entwickler | last post by:
hello, i have the following problem. i want to write a code that enables the user to call functions from a unmanaged code .dll at running time . so i have to use the late binding . i tried the...
10
by: =?Utf-8?B?UmF2aSBTaGFua2Fy?= | last post by:
Hi, I have a requirement where I need to call methods written in VB.Net from a C++ code. I have been going crazy reading various articles on the net w.r.t interop and marshalling but an more...
1
by: Saad | last post by:
Hi, I have a MC++dll, whose functions i want to use in unmanaged c++. I read that one of the ways to use the managed functions in unmanaged world is by exposing the managed api as flat api. I...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.