Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to run any c/c++ and java programme in .net and also want to run .net programme in c/c++
Posted
Comments
Mehdi Gholam 9-Sep-11 21:44pm    
What do you mean by run?

1 solution

C/C++ can be run in .NET environment, using UnManaged code concept as:
C#
[DllImport("user32.dll")]
public static extern int CMessageBox(int h,
            [MarshalAs(UnmanagedType.LPStr)]string m,
            [MarshalAs(UnmanagedType.LPStr)]string c,
            int type);

public static int Main(string args [])
{
    CMessageBox(0, "Hello World!", "My Message Box", 0);
    return 0;
}


Java code can be run in .NET and vice versa using few product like JNBridege http://www.jnbridge.com/[^] and OpenJDK.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900