PinvokeDLL or delegates or ??? ... Calling C# delegates from C++ as CALLBACK

R

Roland Rehmnert

Hello

I have search a lot through the communities to find a way to call a delegate
procedure exported to a native DLL written in C and C++. Interface function
solely in C.

I have found a several articles based on stationary platform techniques, but
not COMPACT FRAMEWORK.

I receive notSupported* error while calling the factility from C#.

What I will do is to have a callback procedure call by any procedure in my
native DLL, such it can raise an event in the compact framework code.

Like this (syntax not nessessary correct)

static int delegate CallBack(int x);

static int myProc(int x) {...}

CallBack cb = new CallBack(myClass.myProc);

[DllImport("myDll")]
static extern int DoSomeWork(CallBack callback);

DoSomeWork(cb):

My question are as follow.
Can this be done in compact framework. Using native DLLs and .NET CF C#?

Can a use ohter technique to achive my goal? (I have taken COM into
consideration, where event my be exported, but not for sure in this case)

How to find out which version of EVC++ STK version I have 4.0 4.1 or 4.2?


Tack
Roland Rehmnert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top