C++ 응용 프로그램에 C++ 함수에 매개 변수를 보내려는 C# 응용 프로그램이 있습니다.DLL에서 엔트리 포인트를 찾을 수 없습니다.
static class SegmentationFunctions
{
[DllImport("MyApplication.dll", EntryPoint = "fnmain", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern int fnmain(string search);
}
}
public partial class MainWindow:Window
{
public MainWindow()
{
InitializeComponent();
string search = "test string here";
int scommand = SegmentationFunctions.fnmain(search);
}
C++ file.h
extern "C" QUERYSEGMENTATION_API int fnmain(char query[MAX_Q_LEN]);
C++ 파일 cpp를
: 그러나, 나는 (제목에 언급 된) 오류C# 응용 프로그램을 얻고있다
extern "C" QUERYSEGMENTATION_API int fnmain(char searchc[MAX_LEN_Q]) { do something... }
QUERYSEGMENTATION_API *는 C++ 프로젝트에서 __declspec (dllexport)로 정의되어 있으며 Dependency Walker에서 MyApplication.dll을 열 때 내 보낸 함수를 볼 수 있습니까 (depends.exe는 확실하지 않은 경우를 위해 Visual Studio 도구입니다))? – adelphus