- Posts: 3
- Joined: Mon Dec 18, 2017 6:58 pm
Hi there,
I'm attempting to call the DeckLinkAPI from within my WPF application. The code paths are essentially a clone of the CaturePreviewCSharp sample, which works just fine, but in my WPF project I'm hitting a failure right here that I can't seem to get past.
This returns the error:
My project references the Interop.DeckLinkAPI (v4.0.30319) that shipped with the SDK. The error occurs both when I try to run in x64 and x86. However, the exact same lines run just fine in the [modified, for my needs] CapturePreviewCSharp sample. Both my project and the SDK sample that works are targeting the .NET Framework 4.6.1.
Googling this general exception suggested that I need to use [ComImport] somewhere, but I want to keep the DeckLinkDevice class intact. and I believe those two are mutually exclusive. Or I just don't understand where I need to put that directive.
Any ideas how to unblock this issue? Thank you so much in advance - I've been pounding my head against the wall on this one
I'm attempting to call the DeckLinkAPI from within my WPF application. The code paths are essentially a clone of the CaturePreviewCSharp sample, which works just fine, but in my WPF project I'm hitting a failure right here that I can't seem to get past.
- Code: Select all
public DeckLinkDevice(IDeckLink deckLink)
{
m_deckLink = deckLink;
// Get input interface
m_deckLinkInput = (IDeckLinkInput)m_deckLink;
...
This returns the error:
System.InvalidCastException: 'Unable to cast COM object of type 'System.__ComObject' to interface type 'DeckLinkAPI.IDeckLinkInput'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{AF22762B-DFAC-4846-AA79-FA8883560995}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).'
My project references the Interop.DeckLinkAPI (v4.0.30319) that shipped with the SDK. The error occurs both when I try to run in x64 and x86. However, the exact same lines run just fine in the [modified, for my needs] CapturePreviewCSharp sample. Both my project and the SDK sample that works are targeting the .NET Framework 4.6.1.
Googling this general exception suggested that I need to use [ComImport] somewhere, but I want to keep the DeckLinkDevice class intact. and I believe those two are mutually exclusive. Or I just don't understand where I need to put that directive.
Any ideas how to unblock this issue? Thank you so much in advance - I've been pounding my head against the wall on this one