Click here to Skip to main content
15,918,333 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: About a time event Pin
FlyingDancer28-Sep-03 22:37
FlyingDancer28-Sep-03 22:37 
GeneralRe: About a time event Pin
jhwurmbach28-Sep-03 22:43
jhwurmbach28-Sep-03 22:43 
GeneralRe: About a time event Pin
FlyingDancer28-Sep-03 23:04
FlyingDancer28-Sep-03 23:04 
GeneralRe: About a time event Pin
Fredrik Skog28-Sep-03 23:46
Fredrik Skog28-Sep-03 23:46 
GeneralRe: About a time event Pin
FlyingDancer29-Sep-03 0:33
FlyingDancer29-Sep-03 0:33 
Generaldirect draw and multimon problem Pin
gwenael28-Sep-03 22:07
gwenael28-Sep-03 22:07 
Generalgraphics query Pin
coda_x28-Sep-03 21:54
coda_x28-Sep-03 21:54 
QuestionAccelerator keys in modeless Dialog? Pin
Brian van der Beek28-Sep-03 21:53
Brian van der Beek28-Sep-03 21:53 
AnswerRe: Accelerator keys in modeless Dialog? Pin
Phil J Pearson29-Sep-03 2:50
Phil J Pearson29-Sep-03 2:50 
GeneralRe: Accelerator keys in modeless Dialog? Pin
Brian van der Beek29-Sep-03 2:59
Brian van der Beek29-Sep-03 2:59 
General"string" problem. Pin
WREY28-Sep-03 21:39
WREY28-Sep-03 21:39 
GeneralRe: "string" problem. Pin
ZoogieZork28-Sep-03 23:22
ZoogieZork28-Sep-03 23:22 
GeneralRe: "string" problem. Pin
Joaquín M López Muñoz28-Sep-03 23:25
Joaquín M López Muñoz28-Sep-03 23:25 
GeneralRe: "string" problem. Pin
WREY29-Sep-03 8:14
WREY29-Sep-03 8:14 
GeneralRe: "string" problem. Pin
Joaquín M López Muñoz29-Sep-03 9:33
Joaquín M López Muñoz29-Sep-03 9:33 
GeneralRe: "string" problem. Pin
WREY29-Sep-03 9:45
WREY29-Sep-03 9:45 
GeneralRe: "string" problem. Pin
Joaquín M López Muñoz29-Sep-03 9:50
Joaquín M López Muñoz29-Sep-03 9:50 
GeneralRe: "string" problem. Pin
WREY29-Sep-03 10:07
WREY29-Sep-03 10:07 
GeneralRe: "string" problem. Pin
David Crow29-Sep-03 5:42
David Crow29-Sep-03 5:42 
GeneralRe: "string" problem. Pin
WREY29-Sep-03 8:34
WREY29-Sep-03 8:34 
GeneralRe: "string" problem. Pin
David Crow29-Sep-03 9:38
David Crow29-Sep-03 9:38 
GeneralRe: "string" problem. Pin
WREY29-Sep-03 9:53
WREY29-Sep-03 9:53 
GeneralSEC_WINNT_AUTH_IDENTITY_EXW Pin
Bernhard28-Sep-03 20:58
Bernhard28-Sep-03 20:58 
GeneralNT service stop event Pin
Aqualic28-Sep-03 20:55
Aqualic28-Sep-03 20:55 
GeneralClipboard content as bitmap Pin
Thoppae28-Sep-03 20:47
Thoppae28-Sep-03 20:47 
Hi All,
I am trying to save the clipboard content as a bmp file. I tried like this:
<br />
//part of code only<br />
HANDLE hBmp;<br />
	 OpenClipboard();<br />
	 hBmp = GetClipboardData(CF_DIB);	 <br />
	if(hBmp)<br />
	{<br />
		if (WriteDIB("c:\\TEST.BMP",GetClipboardData(CF_DIB)) == TRUE)<br />
		{<br />
			MessageBox("Success","BMP Written",NULL);			<br />
		}<br />
		else<br />
		{<br />
			MessageBox("Failed","BMP Write",NULL);<br />
		}<br />
		EmptyClipboard ();<br />
	}<br />
	else<br />
	{<br />
		printerror(GetLastError());<br />
	}<br />
	CloseClipboard();	<br />
//end of func<br />
<br />
<br />
void printerror(long err)<br />
{<br />
	LPVOID lpMsgBuf;<br />
 	FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORM<br />
 AT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSER<br />
TS,NULL,err,MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(LPTSTR)&lpMsgBuf,30,NULL);<br />
	MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );	<br />
		}<br />

I am getting NULL in hBmp. So if condition fails. I tried to get the error code. But error message says "Function completed successfully". Can anyone help me where i went wrong??
Thanks in advance,
Thoppae.

Its Always the Root that helps to Nurture Fruits.The Root is 'C'.

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.