C#下用delegate来实现。你具体指怎么样的调用,API?Event本身也是回调函数呀。如果是API,把API的原型写出来让大家帮你看看。

解决方案 »

  1.   

    public delegate void MyHandler(p);
    在C#里面是委托
      

  2.   

    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;
        }
    }
      

  3.   

    http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/csref/html/vcrefTheDelegateType.asp