C#: Как получить доступ к static struct из C++ dll
От: newalex77  
Дата: 26.03.19 12:25
Оценка:
Есть с++ dll, в которой объявлена статическая структура вида:

typedef int (*reset)(void *context);

typedef int (*update)(void *context, const uint8_t *data, size_t length);

typedef int (*finalize)(void *context,uint8_t *digest);

typedef struct
{
reset reset;
update update;
finalize finalize;
size_t context_size;
size_t block_size;
size_t digest_si
} main_struct;

Как получить доступ к main_struct из C# ?

При попытках вида:
[DllImport(fileDLL)]
public static Main_struct main_struct;
компилятор выдает ошибку: Аttribute 'DllImport' is not valid on this declaration type. It is only valid on 'method' declarations.
c# dllimport static struct
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.