For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > August 2005 > [DllImport("Kernel32.dll", SetLastError=true, EntryPoint="lstrcpyA&quo









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [DllImport("Kernel32.dll", SetLastError=true, EntryPoint="lstrcpyA&quo
Ravindra Kishore

2005-08-22, 7:57 am

Hi,

I am trying to do copy string using Kernel32.dll.

string s = new string(' ',uLength);

CopyStringAx(out s,(nPos + 4) // nPos is obtained thro' other
win32 Apis

//CopyStringAx is name of below defined functions

string is not getting copied into s. Please let me your comments.

Here is set of declaration, i tried on lstrcpyA.

[DllImport("Kernel32.dll", SetLastError=true, EntryPoint="lstrcpyA")]

public static extern void CopyString (out string Dest , System.UInt32
strSrc );

[DllImport("Kernel32.dll", SetLastError=true, EntryPoint="lstrcpyA")]

public static extern void CopyStringA (string Dest , System.UInt32 strSrc );

[DllImport("Kernel32.dll", SetLastError=true, EntryPoint="lstrcpyA")]

public static extern void CopyStringA1 (string Dest , int strSrc );

[DllImport("Kernel32.dll", SetLastError=true, EntryPoint="lstrcpyA")]

public static extern void CopyStringA2 (out string Dest , int strSrc );

[DllImport("Kernel32.dll", SetLastError=true, EntryPoint="lstrcpyA")]

public static extern void CopyStringA3 (out string Dest , IntPtr strSrc );

regards,

Ravindra Kishore



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com