Joachim,
You wouldn't create a class, but rather a structure in .NET. I'll leave
the process of defining that correctly for interop with you.
Once you have that structure definition, you can call the static
PtrToStruct method on the Marshal class, passing the IntPtr which is the
pointer to the structure in memory. The PtrToStruct method will read the
unmanaged memory and marshal the information over into a new instance of
your structure.
Hope this helps.
"Joachim" <Jo*****@discussions.microsoft.comwrote in message
news:18**********************************@microsof t.com...
>I have a C++ application which does the following:
AM_MEDIA_TYPE l_MediaType;
pGrabber->GetConnectedMediaType(&l_MediaType);
// Get a pointer to the video header.
VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADER*)l_MediaType.pbFormat;
I beleive that in C# l_MediaType.pbFormat corresponds to
l_media_type.formatPtr. How can I convert the IntPtr resulting from there
to
a VideoInfoHeader class in C#?