WPF + C++ (DLLImport)
test.cpp--------------------------------------------
#include <stdio.h>
extern "C"
{
__declspec(dllexport) void DisplayHelloFromDLL()
{
printf ("Hello from DLL !\n");
}
}
----------------------------------------------------
test.cs----------------------------------------------
using System;
using System.Runtime.InteropServices;
class HelloWorld
{
[DllImport("TestLib.dll")]
public static extern void DisplayHelloFromDLL ();
static void Main ()
{
Console.WriteLine ("This is C# program");
DisplayHelloFromDLL ();
}
}
----------------------------------------------------
요렇게 하면 된다...젠장...
왜 삽질했을까..ㅎㅎ
'Study > C#' 카테고리의 다른 글
Window Form - [STAThread]의 의미는? (0) | 2011.08.01 |
---|