locked
Managed unManaged code RRS feed

  • Question

  • Hello

    I have to do some ethernet development, and I was planning to create a .NET class library for this development.  The application that will host that, is a c++ application.  What is the best approach to call between the two? 

    Tuesday, February 21, 2012 7:49 PM

Answers

  • Typically, the "cleanest" way to host managed code within a C++ application is to use C++/CLI.

    This allows the C++ application to directly interface with a C# library.

     

    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Marked as answer by Bob Shen Monday, March 5, 2012 2:24 AM
    Tuesday, February 21, 2012 8:04 PM
  • MSFT has an acronym for that IPC assuming both programs are their own process.  WCF provides some nice alternatives in that both applications can communicate with WCF locally or remote.  Some talk about MESSAGEBUS architecture, other's use SQL...  There's even a new thing called ReactiveExtensions  which is a pushed based messaging system (very cool and more in line with events)...   You also have MSMQ (store and forward technology old as dirt and super reliable)...

    Pick your poison, I like to stay away from IPC as it's unfamiliar and older architecture (to me), I like WCF personally.  MSMQ while reliable can be tough to work with.  ReactiveExtentions looks really cool to me but haven't had time to digest yet.


    JP Cowboy Coders Unite!

    • Marked as answer by Bob Shen Monday, March 5, 2012 2:24 AM
    Tuesday, February 21, 2012 8:06 PM
  • Yes here's a simple WCF example showing a messaging construct.

    http://msdn.microsoft.com/en-us/library/ms734675.aspx


    JP Cowboy Coders Unite!

    • Marked as answer by Bob Shen Monday, March 5, 2012 2:24 AM
    Tuesday, February 21, 2012 8:13 PM

All replies

  • Typically, the "cleanest" way to host managed code within a C++ application is to use C++/CLI.

    This allows the C++ application to directly interface with a C# library.

     

    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Marked as answer by Bob Shen Monday, March 5, 2012 2:24 AM
    Tuesday, February 21, 2012 8:04 PM
  • MSFT has an acronym for that IPC assuming both programs are their own process.  WCF provides some nice alternatives in that both applications can communicate with WCF locally or remote.  Some talk about MESSAGEBUS architecture, other's use SQL...  There's even a new thing called ReactiveExtensions  which is a pushed based messaging system (very cool and more in line with events)...   You also have MSMQ (store and forward technology old as dirt and super reliable)...

    Pick your poison, I like to stay away from IPC as it's unfamiliar and older architecture (to me), I like WCF personally.  MSMQ while reliable can be tough to work with.  ReactiveExtentions looks really cool to me but haven't had time to digest yet.


    JP Cowboy Coders Unite!

    • Marked as answer by Bob Shen Monday, March 5, 2012 2:24 AM
    Tuesday, February 21, 2012 8:06 PM
  • Do you have any examples?

    Tuesday, February 21, 2012 8:09 PM
  • Yes here's a simple WCF example showing a messaging construct.

    http://msdn.microsoft.com/en-us/library/ms734675.aspx


    JP Cowboy Coders Unite!

    • Marked as answer by Bob Shen Monday, March 5, 2012 2:24 AM
    Tuesday, February 21, 2012 8:13 PM