473,399 Members | 4,192 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,399 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 1581
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tim Tyler | last post by:
Like C, Python seems to insist I declare functions before calling them - rather than, say, scanning to the end of the current script when it can't immediately find what function I'm referring to. ...
7
by: Andrzej | last post by:
Is it possible to call a function which name is given by a string? Let assume that I created a program which call some functions for example void f1(void), void f2(void), void f3(void). ...
8
by: Arno R | last post by:
Hi all, Is the above possible? I guess I need an API call for this ? How and where to find this? One of my new apps is used as a sort of 'dedicated' thing. Users see an empty desktop with...
13
by: Alison Givens | last post by:
....... that nobody knows the answer. I can't imagine that I am the only one that uses parameters in CR. So, my question again: I have the following problem. (VB.NET 2003 with CR) I have a...
11
by: vbgunz | last post by:
Hello all, I am just learning Python and have come across something I feel might be a bug. Please enlightenment me... The following code presents a challenge. How in the world do you provide an...
4
by: Zark3 | last post by:
Hi all, I was wondering if anybody could enlighten me on the possibility of dynamic casting. Or, well, whether or not I'm actually trying to do this the right way. What I have is a base class...
4
by: Pritcham | last post by:
Hi all I've got a number of classes already developed (basic entity classes) like the following: Public Class Contact Private _firstname as String Private _age as Integer Public Property...
0
by: hastha23 | last post by:
Dear Friends, My oracle Version is 10g. I calling a function from sql select same time function body contain DML statement,that time is possible call function from sql? and again one, ...
1
by: Y1M43 | last post by:
i'm a newbie in learning java currently. So, can anyone tell me is it possible that we call the calculator program from the WindowXP? Mine program need a calculator function, therefore is it...
5
by: Simon | last post by:
I heard that we could do that by using AJAX. Could anybody share how to do it? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.