Click here to Skip to main content
15,914,409 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: isinf function Pin
jayashri200622-May-06 11:01
jayashri200622-May-06 11:01 
GeneralRe: isinf function Pin
David Crow22-May-06 11:06
David Crow22-May-06 11:06 
GeneralRe: isinf function Pin
jayashri200623-May-06 4:20
jayashri200623-May-06 4:20 
GeneralRe: isinf function Pin
David Crow24-May-06 2:36
David Crow24-May-06 2:36 
GeneralRe: isinf function Pin
jayashri200624-May-06 11:56
jayashri200624-May-06 11:56 
GeneralRe: isinf function Pin
David Crow25-May-06 2:40
David Crow25-May-06 2:40 
GeneralRe: isinf function Pin
jayashri200626-May-06 9:06
jayashri200626-May-06 9:06 
QuestionPasting into a CEdit Control on a Dialog Pin
Doug Knudson22-May-06 9:55
Doug Knudson22-May-06 9:55 
Hi All,

In VS 6 I copy data from a custom control on a dialog using my own clipboard management (see code below) and would like to paste it into a CEdit on the same dialog. I believe I am getting it to the clipboard correctly, in CF_TEXT format because I can paste the text into WordPad or Notepad just fine. I am unable, however, to paste my clipboard contents to the CEdit either with the CEdit context menu or Ctrl+V. Making this all the more confusing is that if I copy text from Wordpad, which presumably is in CF_TEXT format, I am able to paste into the standard CEdit just fine.

Any ideas would be greatly appreaciated!

Thanks,
Doug




// This just simulates the text I want to get to the clipboard<br />
	CString cellText = "This is a test";<br />
<br />
<br />
	// Open the clipboard and empty it<br />
	OpenClipboard();<br />
	EmptyClipboard();<br />
<br />
<br />
	// Get a chunk of memory for the formatted text<br />
	int dataStringLen = cellText.GetLength();<br />
	HANDLE dataHandle = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,dataStringLen + 1);<br />
	char *memPtr = (char *)GlobalLock(dataHandle);<br />
<br />
<br />
	// Copy the data to our mem block<br />
	memcpy(memPtr,(char *)(LPCTSTR)cellText,dataStringLen + 1);<br />
	memPtr[dataStringLen] = '\0';<br />
<br />
<br />
	// Unlock the handle, place the data on the clipboard and then free the<br />
	// handle<br />
	GlobalUnlock(dataHandle);<br />
	SetClipboardData(CF_TEXT,dataHandle);<br />
	GlobalFree(dataHandle);<br />
<br />
	CloseClipboard();


Doug Knudson
AnswerRe: Pasting into a CEdit Control on a Dialog Pin
zt978822-May-06 17:58
zt978822-May-06 17:58 
GeneralRe: Pasting into a CEdit Control on a Dialog Pin
Doug Knudson23-May-06 2:20
Doug Knudson23-May-06 2:20 
QuestionReading from a ListBox Pin
Mahhouraaaaaa22-May-06 8:09
Mahhouraaaaaa22-May-06 8:09 
AnswerRe: Reading from a ListBox Pin
David Crow22-May-06 8:47
David Crow22-May-06 8:47 
AnswerRe: Reading from a ListBox Pin
Laxman Auti22-May-06 19:06
Laxman Auti22-May-06 19:06 
QuestionSharing precompiled header in VC+ 2005 Pin
topus22-May-06 7:39
topus22-May-06 7:39 
AnswerRe: Sharing precompiled header in VC+ 2005 Pin
David Crow22-May-06 7:44
David Crow22-May-06 7:44 
GeneralRe: Sharing precompiled header in VC+ 2005 Pin
topus23-May-06 0:12
topus23-May-06 0:12 
QuestionResizing child frame with nested csplitterwnd Pin
Tarek Jabri22-May-06 7:37
Tarek Jabri22-May-06 7:37 
AnswerRe: Resizing child frame with nested csplitterwnd Pin
led mike22-May-06 7:54
led mike22-May-06 7:54 
GeneralRe: Resizing child frame with nested csplitterwnd Pin
Tarek Jabri22-May-06 8:01
Tarek Jabri22-May-06 8:01 
GeneralRe: Resizing child frame with nested csplitterwnd Pin
led mike22-May-06 8:10
led mike22-May-06 8:10 
QuestionSQL Server tables are readonly, why? Pin
e-DJ22-May-06 6:40
e-DJ22-May-06 6:40 
QuestionRe: SQL Server tables are readonly, why? Pin
David Crow22-May-06 6:49
David Crow22-May-06 6:49 
AnswerRe: SQL Server tables are readonly, why? Pin
e-DJ23-May-06 5:45
e-DJ23-May-06 5:45 
QuestionRe: SQL Server tables are readonly, why? Pin
David Crow24-May-06 2:32
David Crow24-May-06 2:32 
AnswerRe: SQL Server tables are readonly, why? Pin
e-DJ24-May-06 4:13
e-DJ24-May-06 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.