467,132 Members | 1,207 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,132 developers. It's quick & easy.

Is it possible to call a c++ function from c-sharp.


I know it can be done in a dll, but is it possible to call a c++ / c
function directly from c-sharp.

-chip
Nov 15 '05 #1
  • viewed: 1434
Share:
3 Replies
No, You have to use the PInvoke services in order to call exported C style
functions from C#.
please check the PInvoke services in MSDN.

Willy.

"chip" <no****@hotmail.com> wrote in message
news:e8****************@TK2MSFTNGP09.phx.gbl...

I know it can be done in a dll, but is it possible to call a c++ / c
function directly from c-sharp.

-chip

Nov 15 '05 #2

"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:ug***************@TK2MSFTNGP11.phx.gbl...
No, You have to use the PInvoke services in order to call exported C style
functions from C#.
please check the PInvoke services in MSDN.

Thank you,

So, that means that it is not possible to add a c++ source
to a c# project directly and link them together,
I have to make it in a dll ?

-chip
Willy.

"chip" <no****@hotmail.com> wrote in message
news:e8****************@TK2MSFTNGP09.phx.gbl...

I know it can be done in a dll, but is it possible to call a c++ / c
function directly from c-sharp.

-chip


Nov 15 '05 #3

"chip" <no****@hotmail.com> wrote in message
news:eg****************@TK2MSFTNGP11.phx.gbl...

"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:ug***************@TK2MSFTNGP11.phx.gbl...
No, You have to use the PInvoke services in order to call exported C
style
functions from C#.
please check the PInvoke services in MSDN.


Thank you,

So, that means that it is not possible to add a c++ source
to a c# project directly and link them together,
I have to make it in a dll ?


Right.

Willy.
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Tim Tyler | last post: by
13 posts views Thread by Alison Givens | last post: by
11 posts views Thread by vbgunz | last post: by
4 posts views Thread by Zark3 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.