Click here to Skip to main content
15,920,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Substing in VC++ Pin
Programm3r9-Nov-06 3:49
Programm3r9-Nov-06 3:49 
AnswerRe: Substing in VC++ Pin
David Crow9-Nov-06 3:13
David Crow9-Nov-06 3:13 
GeneralRe: Substing in VC++ Pin
Programm3r9-Nov-06 3:49
Programm3r9-Nov-06 3:49 
Question.cab files read in binary mode Pin
apoorva_raje9-Nov-06 2:37
apoorva_raje9-Nov-06 2:37 
AnswerRe: .cab files read in binary mode Pin
Monty29-Nov-06 2:43
Monty29-Nov-06 2:43 
GeneralRe: .cab files read in binary mode Pin
apoorva_raje9-Nov-06 3:03
apoorva_raje9-Nov-06 3:03 
AnswerRe: .cab files read in binary mode Pin
David Crow9-Nov-06 3:15
David Crow9-Nov-06 3:15 
QuestionWin32 clipboard Pin
WernerP9-Nov-06 1:49
WernerP9-Nov-06 1:49 
Hi,

I have tried to use the Win32 clipboard API to copy text to the clipboard, but ist doesn't show up when I try to paste it to a text editor. There is also no Clipboard Format available in the clipboard when I use EnumClipboardFormats. I've used a tutorial cooking book to write that code.

Can you say what's wrong?
Thanks.

void Clipboard::setTo(string const strData)
{
string::size_type const sizeData = strData.size() * sizeof(TCHAR);
HANDLE hData = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, sizeData);
if (hData) {
LPTSTR tszData = static_cast<LPTSTR>( ::GlobalLock(hData) );
memcpy(tszData, strData.c_str(), sizeData);
::GlobalUnlock(hData);
::OpenClipboard(NULL);
::EmptyClipboard();
::SetClipboardData(CF_TEXT, hData);
}

UINT uiFmt = 0;
do {
uiFmt = ::EnumClipboardFormats(uiFmt);
} while (0 != uiFmt);

::CloseClipboard();
}

Werner
AnswerRe: Win32 clipboard Pin
Monty29-Nov-06 2:20
Monty29-Nov-06 2:20 
QuestionRe: Win32 clipboard Pin
David Crow9-Nov-06 3:19
David Crow9-Nov-06 3:19 
QuestionSetThreadPriority Pin
messages9-Nov-06 0:43
messages9-Nov-06 0:43 
AnswerRe: SetThreadPriority Pin
Mark Salsbery9-Nov-06 5:16
Mark Salsbery9-Nov-06 5:16 
GeneralRe: SetThreadPriority Pin
messages9-Nov-06 8:16
messages9-Nov-06 8:16 
GeneralRe: SetThreadPriority Pin
Mark Salsbery9-Nov-06 8:24
Mark Salsbery9-Nov-06 8:24 
QuestionCreating a PDF file Pin
_Tom_8-Nov-06 23:41
_Tom_8-Nov-06 23:41 
AnswerRe: Creating a PDF file Pin
Rudolf Jan9-Nov-06 0:10
Rudolf Jan9-Nov-06 0:10 
AnswerRe: Creating a PDF file Pin
Hamid_RT9-Nov-06 1:14
Hamid_RT9-Nov-06 1:14 
GeneralRe: Creating a PDF file Pin
Cedric Moonen9-Nov-06 1:36
Cedric Moonen9-Nov-06 1:36 
GeneralRe: Creating a PDF file Pin
Aqueel9-Nov-06 1:47
Aqueel9-Nov-06 1:47 
AnswerRe: Creating a PDF file Pin
Sebastian Schneider9-Nov-06 1:52
Sebastian Schneider9-Nov-06 1:52 
GeneralRe: Creating a PDF file Pin
_Tom_9-Nov-06 2:05
_Tom_9-Nov-06 2:05 
GeneralRe: Creating a PDF file Pin
normanS9-Nov-06 23:26
normanS9-Nov-06 23:26 
QuestionThreads Pin
baerten8-Nov-06 23:40
baerten8-Nov-06 23:40 
AnswerRe: Threads Pin
Michael Dunn9-Nov-06 0:01
sitebuilderMichael Dunn9-Nov-06 0:01 
GeneralRe: Threads Pin
baerten9-Nov-06 0:37
baerten9-Nov-06 0:37 

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.