Hi,
When i copy the string text first time it copy successfully,When i copy the string text second time i am getting error, why i am getting error i don't know ,Any one help me to resolve this error, I am giving my code below.
string text;
OpenClipboard(IntPtr.Zero);
if (id == 1)
{
text= "First time";
}
else if (id == 2)
{
text= "Second time";
}
var ptr = Marshal.StringToHGlobalUni(text);
SetClipboardData(13, ptr);
CloseClipboard();
Marshal.FreeHGlobal(ptr);