[DllImport("kernel32")] private static unsafe extern void *lstrcpyn(
     [MarshalAs(UnmanagedType.FunctionPtr)] GeneratedDelegate2 d, void *pSrc, int maxLength);
        //These helper functions are generated as a workaround to allow
        //	the conversion of a Delegate to void *.  This allows the user
        //	to avoid dealing with the Marshalling of delegates when
        //	allowing unmanaged code to call a C# function.

        public static unsafe void *DelegateToPtr(GeneratedDelegate2 d)
        {
            return(lstrcpyn(d, null, 0));
        }