Я проверил обертку в своей собственной библиотеке. Подход: < /p>
Код: Выделить всё
[DllImport("library.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int unmanaged_Function();
// Это нормально
__declspec(dllexport) int unmanaged_Function() {
int r[128];
return 0;
}
< /code>
__declspec(dllexport) int unmanaged_Function() {
void* p = malloc(1024); //
What is the error in the second part?
Подробнее здесь: https://stackoverflow.com/questions/797 ... ction-call
Мобильная версия