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

What is the easy way to provide c# interface to my C++ unmanaged d

Hi,

if i have the unmanaged c++ source files, what is the easy way to provide c#
interface to this unmanaged c++ dll, should i use managed c++ wrapper classes
or use PInvoke or use the /clr compiler option ?

Thanks.

Nov 17 '05 #1
7 1734
Using /clr will not make any difference. You will need to convert your
classes into managed classes and its exposed interfaces must expose cls
compliant types, but this could be easy to accomplish or not. I think that
is a good migration path if you don't need backward compatibility.

If you need to ensure backward compatibility it will be a better option ot
make a managed wrapper arround your current code.

If you only expose your component through interop it will be difficult to
use for managed clients. I would prefer any of the others approach.
--
Un saludo
Rodrigo Corral González [MVP]

FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org
Nov 17 '05 #2
Hi Rodrigo,

- Is there any automated process/tool to generate wrapper classes to my
unmanaged c++ dll ?

- When i use the /clr option i get link error LNK2001: unresolved external
symbol "char * __cdecl strdup(char const *)" (?strdup@@$$J0YAPADPBD@Z) .
how should i solved this error ?

Thanks a lot.

Nov 17 '05 #3
- Is there any automated process/tool to generate wrapper classes to my
unmanaged c++ dll ?
AFAIK, no there isn´t.
- When i use the /clr option i get link error LNK2001: unresolved external


http://support.microsoft.com/kb/814472/en-us
--
Un saludo
Rodrigo Corral González [MVP]

FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org
Nov 17 '05 #4
Hi Rodrigo,

What do you think about the swig tool ?
http://www.swig.org/
it generate c# classes and c++ wrappers using PInvoke.
- should i use it ?

Thanks a lot.

Nov 17 '05 #5
I don´t know. I have not used SWIG. You could try it and tell us if it is a
good tool or not.
--
Un saludo
Rodrigo Corral González [MVP]

FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org

Nov 17 '05 #6
ok , i will.

Thanks Rodrigo.
"Rodrigo Corral [MVP]" wrote:
I don´t know. I have not used SWIG. You could try it and tell us if it is a
good tool or not.
--
Un saludo
Rodrigo Corral González [MVP]

FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org

Nov 17 '05 #7
Hi Rodrigo,

Is there is any differences in the capabiliies of those 3 approaches IJW,
Manage C++ Wrapper classes or PInvoke, for example if i can use polymorphism
in all the approaches in my C# Client ?

Thanks a lot.
Nov 17 '05 #8

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

Similar topics

4
by: John Doe. | last post by:
Hi PHP gurus! Our team will be creating a web-application that must have an easy to use programmatic interface for our web-developer clients. The data transferred will primarily be taken from a...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
11
by: Van Nastring | last post by:
I believe it is c++ right? Why don't they use c#?
26
by: Lasse Edsvik | last post by:
Hello I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager..... what more is needed than this: using System; using...
5
by: VM | last post by:
What's marshalling? I've had to use it extensively for a project but I don't know what it means. I tried to look for a definition in the Internet but I couldn't find anything that would explain...
4
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that...
13
by: Kyle Adams | last post by:
I don't know where is the right place to ask this so I will start here. Can someone explain to me what these represent? I think they all have to do with the middleware level, but I really don't...
1
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello Gurus; I have some strange, complicated and challenging question. This question may show a poor design, and I agree it very poor. But I have some constrainment that must be handled as I'll...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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
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...
0
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,...
0
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...

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.