I am having some trouble passing a C++/CLI object pointer to a native object.
The entire picture is the following:
- I am new to C++ in general (doomed)
- I am using a third party native C++ library to interface a blackmagic IO video card. In the API there is a very handy method to pass a pointer of the object that will handle the frame callback while they are captured by the card: SetCallback(Pointer to an object that implement an interface).
- In the above SetCallback(Pointer) I would like to pass the pointer to my C++/CLI object. When I do so
I get:
cannot convert argument 4 from 'CLIInterop::Wrapper ^*' to 'IDeckLinkInputCallback *'
My final target is to handle the callback from C++ into C++/CLI and at this point pass the frame over to WPF (if I will ever get that far)
The line of code invoved are:
Call from CLIInterop::Wrapper object
d_Controller->GetDevice()->StartCapture(0, nullptr, true, this);
Method header in the native C++ project:
__declspec(dllexport) bool DeckLinkDevice::StartCapture(unsigned int videoModeIndex, IDeckLinkScreenPreviewCallback* screenPreviewCallback, bool applyDetectedInputMode, IDeckLinkInputCallback* callbackHandler);
Help!
gcroot<ManagedClass>
or stackoverflow.com/a/2973278/17034 – Hans Passant