Click here to Skip to main content
15,905,504 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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'.
Generalabout CListCtrl Pin
muddog28-Sep-03 20:37
muddog28-Sep-03 20:37 
GeneralRe: about CListCtrl Pin
chifor28-Sep-03 20:53
chifor28-Sep-03 20:53 
GeneralRe: about CListCtrl Pin
Abin28-Sep-03 22:19
Abin28-Sep-03 22:19 
QuestionProperty Pages Help??? Pin
xxhimanshu28-Sep-03 20:12
xxhimanshu28-Sep-03 20:12 
AnswerRe: Property Pages Help??? Pin
Steve Mayfield28-Sep-03 20:56
Steve Mayfield28-Sep-03 20:56 
GeneralError C2679 Pin
esepich28-Sep-03 19:57
esepich28-Sep-03 19:57 
GeneralRe: Error C2679 Pin
KarstenK28-Sep-03 20:36
mveKarstenK28-Sep-03 20:36 
GeneralRe: Error C2679 Pin
Steve Mayfield28-Sep-03 20:48
Steve Mayfield28-Sep-03 20:48 
QuestionHow to make Virtual CDROM / Virtual Device Driver ? Pin
silver_csc28-Sep-03 19:56
silver_csc28-Sep-03 19:56 
GeneralRetriving System Device Icons Pin
Member 40481328-Sep-03 19:46
Member 40481328-Sep-03 19:46 
GeneralRe: Retriving System Device Icons Pin
David Crow29-Sep-03 5:51
David Crow29-Sep-03 5:51 
GeneralRecently Used File Pin
vancouver77728-Sep-03 19:36
vancouver77728-Sep-03 19:36 
GeneralRe: Recently Used File Pin
chifor28-Sep-03 20:43
chifor28-Sep-03 20:43 
GeneralRe: Recently Used File Pin
sdfdsfa28-Sep-03 22:32
sdfdsfa28-Sep-03 22:32 
GeneralDialog as a window Pin
Shamsuddin Alvi28-Sep-03 18:06
sussShamsuddin Alvi28-Sep-03 18:06 
GeneralRe: Dialog as a window Pin
Phil Martin28-Sep-03 18:27
professionalPhil Martin28-Sep-03 18:27 
GeneralRe: Dialog as a window Pin
Steve Mayfield28-Sep-03 18:52
Steve Mayfield28-Sep-03 18:52 

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.