Thread: how to call c++ function from c# program ?

  1. #1
    Registered User gilit2's Avatar
    Join Date
    Jan 2011
    Location
    Israel
    Posts
    10

    how to call c++ function from c# program ?

    what is the techniuqe to call c++ functions from c# ?
    I need code example for it , (to see the parameters and arguments )
    and instructions how to compile it.
    I have visual studio professional 2010.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    First understand that we are not at your beckon call. Second we need to see some type of attempt or stab at this before we help.

    I'll give you this hint for now. You cannot call directly into C++ via P/Invoke. For that you will need a managed class that maintains an unmanaged pointer and exposes a public method that calls the C++ method via the unmanaged pointer.

    On a side note you seem to have a recent history of posting vague questions here with the intent that people will spoon feed you the answer. I recommend you read our forum guidelines as to the correct usage of this forum as well as suggestions on how to ask questions.
    Last edited by VirtualAce; 02-06-2011 at 11:51 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Troubleshooting Input Function
    By SiliconHobo in forum C Programming
    Replies: 14
    Last Post: 12-05-2007, 07:18 AM
  2. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM
  3. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  4. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 01:03 PM
  5. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM