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*****@discus sions.microsoft .comwrote in message
news:18******** *************** ***********@mic rosoft.com...
>I have a C++ application which does the following:
AM_MEDIA_TYPE l_MediaType;
pGrabber->GetConnectedMe diaType(&l_Medi aType);
// Get a pointer to the video header.
VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADE R*)l_MediaType. pbFormat;
I beleive that in C# l_MediaType.pbF ormat corresponds to
l_media_type.fo rmatPtr. How can I convert the IntPtr resulting from there
to
a VideoInfoHeader class in C#?