A
A
Avery0072014-05-13 13:42:19
C++ / C#
Avery007, 2014-05-13 13:42:19

How to pass a C# function as a parameter to a native function?

The library has a certain function, let's say Func, I have this function declared in C#:

[DllImport("library.dll")]
[SuppressUnmanagedCodeSecurity()]
public static extern void Func(тут нужна ссылка на функцию);

In the .h file, it is declared like this:
void (LIBCALLBACK *func)(void);
I think simple delegates are indispensable here.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CAMOKPYT, 2014-05-13
@Avery007

msdn.microsoft.com/en-us/library/ac7ay120(v=vs.110...
msdn.microsoft.com/en-us/library/843s5s5x(v=vs.110...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question