472,096 Members | 1,277 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

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
3 1527
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
reply views Thread by leo001 | last post: by

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.