转换C ++ struct&原型到C#代码 [英] Convert C++ struct & prototype to C# code
本文介绍了转换C ++ struct&原型到C#代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将此C ++代码转换为C#
typedef void (CALLBACK * VideoCaptureCB_Ptr)(PVOID pContext,BYTE * apData [ 3 ],VideoSampleInfo_T * pVSI);
typedef struct _VideoSampleInfo_T
{
ULONG idFormat; //
ULONG lSignalState;
int nLen; // 未用于原始视频数据(例如YUV420)
int nWidth;
int nHeight;
int anPitchs [ 3 ]; // 仅用于原始视频数据(例如YUV420)
ULONG dwMicrosecsPerFrame; // 1000 * 1000 / FPS
ULONG字段;
int iSerial;
} VideoSampleInfo_T;
这个问题可能违反CodeProject规则。但是我不知道让我的问题更长更容易理解。
谢谢提前。
解决方案
答案相当好地讨论了
C#中的typedef [ ^ ]
如果你想真正掌握最终的微软6部分系列
使用C#2.0对数据结构进行广泛的检查
http://msdn.microsoft.com/en-us/library/ms379570%28VS.80%29.aspx [ ^ ]
开始在那里,看看你如何去告诉我们你是否需要任何具体的建议。
How to convert this C++ code to C#
typedef void (CALLBACK * VideoCaptureCB_Ptr)(PVOID pContext, BYTE * apData[3], VideoSampleInfo_T * pVSI); typedef struct _VideoSampleInfo_T { ULONG idFormat; // ULONG lSignalState; int nLen; // not used for raw video data(e.g. YUV420) int nWidth; int nHeight; int anPitchs[3]; // only used for raw video data(e.g. YUV420) ULONG dwMicrosecsPerFrame; // 1000*1000/FPS ULONG field; int iSerial; } VideoSampleInfo_T;
This question maybe break the CodeProject rule. But't I have no idea to make my question more longer and easy to understand.
Thanks is advance.解决方案The answer is reasonably well discussed in
typedef in C#[^]
And if you want to really get your teeth in the definitive Microsoft 6 part series
"An Extensive Examination of Data Structures Using C# 2.0"
http://msdn.microsoft.com/en-us/library/ms379570%28VS.80%29.aspx[^]
Start there, see how you go and let us know if you need any specific advice.
这篇关于转换C ++ struct&原型到C#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文