C#????C++???????Щ???
???????????? ???????[ 2015/1/26 13:34:23 ] ????????C# C++ net
????c#????c++????????????????д
????[DllImport("UCamer.dll"?? CallingConvention = CallingConvention.Winapi)]
????public extern static void Disp_Destroy(IntPtr hShow);
????DllImport??????????UCamer.dll??????dll??·??????dll??????????е????????c:windows/sytem32??
????CallingConvention ??????c#????c++???? ?????? msdn????????
??????????????Winapi??????????????????ù????? ??thisCall???c++?????÷????? ???? ???????????????Winapi???????
????c#????dll???????????????????
????http://wenku.baidu.com/link?url=SihlxtHC-HMcEhq3izpd2bux8rNaKOMTpu8NPqjdYlLSwYSV1CqNJdVbxkaZm7OqaaSTEK-KUJqX5jbtkdpnUZ_38No4tsrgqCsf7Th5dqK
??????????????????????c++??c#???????????????????????????????????
????1??????????????£???????????????????????????? ??c++?е?????????char[] ?????????char[] ????κθ??
????c++??char????????assic??????c#?е?char?2??????????????????vs?в???????
??????????????????????????????????磬?????д?????????????????
????????????? ??char[] ???c#?е?byte[] ??????Encoding.Assic.getstring?????????
????2?????????c++???е???? ??c#????Intptr ????????????????緵???Intptr????????????c#???????????????????????????
????Marshal.Copy();
????Marshal????c#????????й??????????й????????????????unsafe?? Marshal??copy?????????????????????16??????????????????????????????
????msdn?ж???????????????
???????????????ù????????????в????????????????
//??????????????С?????
myContext = new VlcControlWpfRendererContext(width?? height?? System.Windows.Media.PixelFormats.Bgr24);
//???????????????
myBitmapSectionPointer = Win32Interop.CreateFileMapping(new IntPtr(-1)?? IntPtr.Zero?? Win32Interop.PageAccess.ReadWrite?? 0?? myContext.Size?? null);
//???????????????
map = Win32Interop.MapViewOfFile(myBitmapSectionPointer?? Win32Interop.FileMapAccess.AllAccess?? 0?? 0?? (uint)myContext.Size);
//??????????????????????
Win32Interop.CopyMemory(map?? data?? myContext.Size);
//?????????е???????????
myBitmap = (InteropBitmap)Imaging.CreateBitmapSourceFromMemorySection(myBitmapSectionPointer?? myContext.Width?? myContext.Height?? myContext.PixelFormat?? myContext.Stride?? 0);
|
?????????????????????? ??????Щapi????
???????Intptr??????????Int??Int??c#?к?Int32????????????????????Long??int??c#?ж???int?????????Щ ?????????????c++?е????????????????????
????3??c++?е??????? ??c#?е????
????????c++?ж???????????
????typedef VOID (WINAPI *PUSERCALL)( PUCHAR pData?? ULONG Length?? PVOID pUserData );
???????c#?е?????????
????public delegate void PUSERCALL(IntPtr pData?? uint Length?? UInt32 pUserData);
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11