CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    1

    c++ functions called from c#

    Hi,

    I've written a distributed programming tool in c# according to a standard that was created for c. In that standard, the user will call functions like this:
    Code:
    int x = function1(buffer, error);
    I want the user to be able to call my c# functions in this way, rather than in an object-oriented way like this:
    Code:
    Function1 function = new Function1(buffer, error);
    int x = function.return;
    or like this:
    Code:
    int x = ToolboxClass.function1(buffer, error);
    I've been told that I might be able to create a c++ wrapper around the c# functions, so that when the user calls
    Code:
    int x = function1(buffer, error);
    the c++ 'function1' code will instantiate the appropriate c# classes and deal with namespaces, etc...

    Is this possible? I'm not very familiar with c++. The user should ideally be able to call the c++ wrapper functions from a c# program or a c++ program.

    Cheers

  2. #2
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    Re: c++ functions called from c#

    moved to C#
    If you think you CAN, you can, If you think you CAN'T, you are probably right.

    Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.

  3. #3
    Join Date
    Jun 2004
    Location
    New Jersey, USA
    Posts
    341

    Re: c++ functions called from c#

    you lost me,
    do you want ot create code in c++ and use it in c# code or create c++ code in c#, clarify
    "We act as though comfort and luxury were the chief requirements of
    life, when all that we need to make us happy is something to be
    enthusiastic about."

    - Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured