Hi all
I am relatively new to C# programming and have run into a problem that I believe is caused by my C# function declarations. I believe that my C# function must use a CDecl CallingConvention but I do not know how to set this
I am attempting to have a C style DLL perform a Callback to a given function in my C# class passing a pointer to a struct. Currently, I have the callback working ( that is I get my expected events ) but the problem is that my variable ( Pointer to Struct ) is always NULL
ex
private unsafe int my_event_handler(SK_Event *ptr_event, void *pvoid_tag
// ptr_event is always NUL
if ( ptr_event != null
Console.WriteLine("Handler: " + ptr_event->Data.ToString())
I have read numerous articles on managed / unmanaged code using the Marshal class etc. and have seen many different combinations of Attributes and directives that can be applied. My question is, is there a way to force your C# function to have a particular CallingConvention ? ...I have seen how to use this with my DLLImportAttribute but have not been able to apply this to a C# method / delegate function. ...Or Is this even possible
Any help would be appreicated
Thanks in advance
Boot