C# DLL 로드

개발/C++

2. C++ DLL을 C#에서 이용하기

2023.01.31 - [개발/C++] - 1. VS 2019에서 C++ 프로젝트를 DLL로 빌드하기 1. C++ DLL을 C#에서 사용하는 간단한 예제 C++ DLL(CPP.dll) #include extern "C" __declspec(dllexport) int AddNumbers(int a, int b) { return a + b; } C# using System; using System.Runtime.InteropServices;//import하지 않으면 DLLImport 사용 불가! namespace CSharpApp { class Program { [DllImport("CPP.dll")] public static extern int AddNumbers(int a, int b); static v..

njsung
'C# DLL 로드' 태그의 글 목록