Click here to Skip to main content
15,889,383 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Name Mangling Pin
Rahul20067611-Apr-04 4:04
Rahul20067611-Apr-04 4:04 
GeneralProblems with lib file and linking Pin
ravjak24-Mar-04 9:20
ravjak24-Mar-04 9:20 
GeneralRe: Problems with lib file and linking Pin
ian mariano24-Mar-04 17:19
ian mariano24-Mar-04 17:19 
GeneralRe: Problems with lib file and linking Pin
ravjak25-Mar-04 5:17
ravjak25-Mar-04 5:17 
GeneralRe: Problems with lib file and linking Pin
ravjak25-Mar-04 5:22
ravjak25-Mar-04 5:22 
GeneralRe: Problems with lib file and linking Pin
ravjak28-Mar-04 2:42
ravjak28-Mar-04 2:42 
GeneralMixing C++ and C Pin
Member 62566623-Mar-04 8:01
Member 62566623-Mar-04 8:01 
GeneralRe: Mixing C++ and C Pin
ian mariano23-Mar-04 10:17
ian mariano23-Mar-04 10:17 
Refer to Interoperating with Unmanaged Code in the MSDN for more information.

For one, you're mixing Managed C++ with C. If you want to use .NET objects from C, you must expose the .NET objects as COM objects first. You can then call into COM objects using the standard COM API using C++. It is possible to use C, but it's more headache than it's worth.

What is it you're trying to do here?

If you're just trying to show the result from magiccalc, just return the value from the C code without displaying anything:

/*  C automagical calculation routine in don.c   */
int   magiccalc()
{
   /*  some C calculation   */

   return someResult;
}


//  managed C++ in Form1.h
 
//   forward declaration
extern __cdecl int  magiccalc();
 
//   in class Form1
public:
   Form1()
   {
      InitializeComponent();
 
      int   num = magiccalc();

      //  display num here using MessageBox.Show and String.Format
   }


Of course, if the magiccalc or other routine(s) are in an external DLL, use them via Consuming Unmanaged DLL Functions.


Ian Mariano - http://www.ian-space.com/


"We are all wave equations in the information matrix of the universe" - me

GeneralRe: Mixing C++ and C Pin
Member 62566623-Mar-04 10:28
Member 62566623-Mar-04 10:28 
GeneralRe: Mixing C++ and C Pin
ian mariano24-Mar-04 2:01
ian mariano24-Mar-04 2:01 
GeneralRe: Mixing C++ and C Pin
Member 62566625-Mar-04 5:15
Member 62566625-Mar-04 5:15 
GeneralRe: Mixing C++ and C Pin
ian mariano25-Mar-04 9:59
ian mariano25-Mar-04 9:59 
GeneralRe: Mixing C++ and C Pin
Member 62566625-Mar-04 10:22
Member 62566625-Mar-04 10:22 
Generalfind current path (C++ DLL called from C# file) Pin
jazzle23-Mar-04 6:02
jazzle23-Mar-04 6:02 
GeneralRe: find current path (C++ DLL called from C# file) Pin
ian mariano23-Mar-04 10:24
ian mariano23-Mar-04 10:24 
GeneralRe: find current path (C++ DLL called from C# file) Pin
jazzle24-Mar-04 4:48
jazzle24-Mar-04 4:48 
Generalnewbie timer question Pin
zena9923-Mar-04 4:20
zena9923-Mar-04 4:20 
GeneralRe: newbie timer question Pin
zena9923-Mar-04 4:55
zena9923-Mar-04 4:55 
GeneralI need books pls Pin
extremeg21-Mar-04 20:35
extremeg21-Mar-04 20:35 
GeneralRe: I need books pls Pin
ravjak25-Mar-04 7:03
ravjak25-Mar-04 7:03 
General"blinking" word Pin
millienium bear21-Mar-04 0:07
millienium bear21-Mar-04 0:07 
GeneralRe: "blinking" word Pin
ian mariano21-Mar-04 10:47
ian mariano21-Mar-04 10:47 
GeneralRe: "blinking" word Pin
millienium bear22-Mar-04 1:47
millienium bear22-Mar-04 1:47 
GeneralRe: "blinking" word Pin
ian mariano23-Mar-04 9:50
ian mariano23-Mar-04 9:50 
GeneralReturning array references Pin
bisquic19-Mar-04 5:58
bisquic19-Mar-04 5:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.