????DLL ?貧??char *????
[DllImport(“MyDLL.dll")]
// ?????
public static extern int mySum (StringBuilder abuf?? StringBuilder bbuf );
????//DLL??????
extern “C” __declspec(dllexport)  int WINAPI mySum(char * astr??char * bstr)
{
//????char *?????astr??bstr -->abuf?? bbuf????????
return a+b;
}
????DLL ???????
????BOOL EnumWindows(WNDENUMPROC lpEnumFunc?? LPARAM lParam)
using System;
using System.Runtime.InteropServices;
public delegate bool CallBack(int hwnd?? int lParam); //??????к???????
public class EnumReportApp
{
[DllImport("user32")]
public static extern int EnumWindows(CallBack x?? int y);
public static void Main() {
CallBack myCallBack = new CallBack(EnumReportApp.Report); EnumWindows(myCallBack?? 0);
}
public static bool Report(int hwnd?? int lParam)
{
Console.Write("Window handle is ");
Console.WriteLine(hwnd); return true;
}
}
????DLL  ?????   ????????
????BOOL PtInRect(const RECT *lprc?? POINT pt);
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential)]
public struct Point {
public int x;
public int y;
}
[StructLayout(LayoutKind.Explicit)]
public struct Rect
{
[FieldOffset(0)] public int left;
[FieldOffset(4)] public int top;
[FieldOffset(8)] public int right;
[FieldOffset(12)] public int bottom;
}
Class XXXX {
[DllImport("User32.dll")]
public static extern bool PtInRect(ref  Rect r?? Point p);
}