@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The lstrcpyn API !!!!C# Signature: [DllImport("kernel32.dll", CharSet=CharSet.Auto)] static extern IntPtr lstrcpyn( [Out] StringBuilder lpString1, string lpString2, int iMaxLength); !!!!User-Defined Types: None. !!!!Notes: For those having trouble with StringBuilder, the below sample code uses the alternative IntPtr method. !!!!Tips & Tricks: Please add some! !!!!Sample Code: !!!!!C# [DllImport("kernel32", CharSet = CharSet.Auto)] static extern IntPtr lstrcpyn(IntPtr dest, IntPtr src, int len); void FillABuffer(IntPtr dest, int dest_maxlen, string source) { IntPtr tmp_ptr = Marshal.StringToHGlobalAuto(source); lstrcpyn(dest, tmp_ptr, dest_maxlen); Marshal.FreeHGlobal(tmp_ptr); } !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: lstrcpyn@msdn on MSDN
Edit kernel32.lstrcpy
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.