typedef LONG * HLoader;struct _tagData
{
LONG *pLen;
BYTE m_pID[20];
char m_szInfo[256];
TCHAR m_szExtInfo[512];
LPCTSTR lpszDes;
};BOOL Init(BYTE *pBy, char *lpszFile, _tagData *pData, int &nCount, LPCTSTR lpszUser[], const char *lpszIni=NULL, const BYTE *pID=NULL );
void Close( HLoader hLoader );
怎么把这些转成C#?
{
LONG *pLen;
BYTE m_pID[20];
char m_szInfo[256];
TCHAR m_szExtInfo[512];
LPCTSTR lpszDes;
};BOOL Init(BYTE *pBy, char *lpszFile, _tagData *pData, int &nCount, LPCTSTR lpszUser[], const char *lpszIni=NULL, const BYTE *pID=NULL );
void Close( HLoader hLoader );
怎么把这些转成C#?
要做的话把它放到DLL中,这样方便,通用。
用c#来实现,你可以参考其调用api函数的例子:
[StructLayout(LayoutKind.Sequential)]
public struct RECT //可以翻版c++ 中的定义
{
public int left;
public int top;
public int right;
public int bottom;
public int Width() { return right - left; }
public int Height() { return bottom - top; }
public POINT TopLeft() { return new POINT(left, top); }
public SIZE Size() { return new SIZE(Width(), Height()); }
public override string ToString()
{
String s = String.Format("{0}x{1}", TopLeft(), Size());
return s;
}
}
[DllImport("user32.dll")]
public static extern int GetWindowRect(int hwnd, ref RECT rc);//自己翻版方法,参数一样就可以了