Accessing C++ through C#


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Accessing C++ through C#

  1. #1
    Harold Putman Guest

    Accessing C++ through C#


    I have a C++ library that I want to be able to expose to C# clients. I expect
    that I will have to created some kind of managed C++ wrapper in between the
    two. I want the C# side to look very "natural" to C# developers. Are there
    any guidelines for things like the best way to return strings, objects, and
    collections of objects, etc... Should classic COM be involved in this in
    any way?


    Share on Google+

  2. #2
    Peter Drayton Guest

    Re: Accessing C++ through C#

    Hi Harold,

    You're on the right track - MC++ is good for this kind of thing, making it
    quite easy to wrap a traditional C++ library in managed code. As for making
    it easy to consume, I'd suggest you look at the rules for CLS compliance,
    and make sure that the wrapper you expose follows those rules - it'll make
    it easier for C# (and other language) clients to consume the class library.

    As for using classic COM, it's another option, but I'd follow the MC++ route
    first, since I'm guessing it'll be a lot faster to implement.

    Regards,
    Peter

    "Harold Putman" <h.putman@ieee.org> wrote in message
    news:3bb8be57$1@news.devx.com...
    >
    > I have a C++ library that I want to be able to expose to C# clients. I

    expect
    > that I will have to created some kind of managed C++ wrapper in between

    the
    > two. I want the C# side to look very "natural" to C# developers. Are there
    > any guidelines for things like the best way to return strings, objects,

    and
    > collections of objects, etc... Should classic COM be involved in this in
    > any way?
    >
    >



    Share on Google+

Similar Threads

  1. accessing editable DataGrid Field
    By Steven Zilberman in forum ASP.NET
    Replies: 0
    Last Post: 07-01-2003, 09:10 AM
  2. Accessing Informix from Microsoft Access
    By RickM in forum Talk to the Editors
    Replies: 0
    Last Post: 07-24-2002, 09:57 AM
  3. Replies: 0
    Last Post: 10-23-2001, 11:56 PM
  4. Accessing extension classes from a .jar file
    By Nishant Rawat in forum Java
    Replies: 0
    Last Post: 07-06-2001, 03:42 AM
  5. Accessing Public Collection Property
    By Matthew in forum ASP.NET
    Replies: 0
    Last Post: 04-24-2000, 07:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center