본문 바로가기
C#/C# Troubleshooting

PInvokeStackImbalance

by doublerabbits 2022. 8. 29.

 

 

  • 기존 아래와 같이 사용하던 코드에서 에러가 발생
[DllImport("CppLib.dll")]

 

 

  • CallingConvention 추가
[DllImport("CppLib.dll", CallingConvention = CallingConvention.Cdecl)]

C++ : Cdecl

Delphi : StdCall

 

 

 

C++ DLL 을 C# 에서 사용하기

 

C++ DLL 을 C# 에서 사용하기

1. Visual Studio 에서 솔루션 구성을 위한 빈 솔루션 생성 기타 프로젝트 형식 - Visual Studio 솔루션 - 빈 솔루션 2. C++ DLL 프로젝트 생성 추가 - 새 프로젝트 Visual C++ - Windows 데스크톱 - DLL(동적 연..

doublerabbits.tistory.com