struct UIM_BOOK_STRUCT
{
int UimIndex;
char szName[15];
char szPhone[21];
};
int ReadUimAllBook(UIM_BOOK_STRUCT lpUimBookItem[]??int nMaxArraySize);

 

 ????C#????

 

[StructLayout(LayoutKind.Sequential?? CharSet = CharSet.Ansi)]//???????????????
public struct UIM_BOOK_STRUCT
{
public int UimIndex;
[MarshalAs(UnmanagedType.ByValTStr?? SizeConst= 15)]
public string szName;
[MarshalAs(UnmanagedType.ByValTStr?? SizeConst= 21)]
public string szPhone;
};
[DllImport( "CdmaCard.dll"??EntryPoint="ReadUimAllBook")]
public    static    extern   int ReadUimAllBook([Out] UIM_BOOK_STRUCT [] lpUimBookItem??int nMaxArraySize);
UIM_BOOK_STRUCT[] p = new UIM_BOOK_STRUCT[20];
int ret = ReadUimAllBook(p??p.Length);

????6. ???????
???????????£????μ???????
????(1) long ???????C++????4????????????C#????8????????;
????(2) ?????????????ò????;
?????????????????window????

 

[System.Security.SuppressUnmanagedCodeSecurity] // We won't use this maliciously
[DllImport("User32.dll"?? CharSet=CharSet.Auto)]
public static extern bool ScreenToClient(IntPtr hWnd?? ref System.Drawing.Point rect);
[System.Security.SuppressUnmanagedCodeSecurity] // We won't use this maliciously
[DllImport("User32.dll"?? CharSet=CharSet.Auto)]
public static extern bool GetWindowRect(IntPtr hWnd?? out System.Drawing.Rectangle rect);
[System.Security.SuppressUnmanagedCodeSecurity] // We won't use this maliciously
[DllImport("User32.dll"?? CharSet=CharSet.Auto)]
public static extern bool UnregisterClass([MarshalAs(UnmanagedType.LPTStr)] string className?? IntPtr instanceHandle);