Click here to Skip to main content
15,893,622 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionThread sync Pin
columbos1492718-Dec-11 3:28
columbos1492718-Dec-11 3:28 
AnswerRe: Thread sync Pin
Chris Losinger18-Dec-11 4:24
professionalChris Losinger18-Dec-11 4:24 
GeneralRe: Thread sync Pin
columbos1492718-Dec-11 4:35
columbos1492718-Dec-11 4:35 
Questionclipboard and file Pin
Member 820281618-Dec-11 0:37
Member 820281618-Dec-11 0:37 
AnswerRe: clipboard and file Pin
Richard MacCutchan18-Dec-11 1:19
mveRichard MacCutchan18-Dec-11 1:19 
GeneralRe: clipboard and file Pin
Member 820281618-Dec-11 1:54
Member 820281618-Dec-11 1:54 
GeneralRe: clipboard and file Pin
Richard MacCutchan18-Dec-11 4:28
mveRichard MacCutchan18-Dec-11 4:28 
GeneralRe: clipboard and file Pin
Member 820281618-Dec-11 5:35
Member 820281618-Dec-11 5:35 
From the file manager I select a file and I copy it in the clipboard than I debug this code and that numbers are the values in the variable format. This code open the clipboard and load every clipboard's format in a list.

////
struct formato{
	UINT tipo;
	int dim;
	char * dato;
};
////

listFormati.erase(listFormati.begin(),listFormati.end());  
			
if(!OpenClipboard(hWnd))
	MessageBox(hWnd,_T("OpenClipboard"),_T("Error"),MB_OK);
				
//numbers of format in the clipboard
unsigned int countFormat= CountClipboardFormats();
UINT format=0;

//for every format in the clipboard
for(int i=0;i<countFormat;i++){
	//extract the next clipboard's format
	format=EnumClipboardFormats(format);
					
	HGLOBAL hglb;
			
	//get from the clipboard the format
	hglb = GetClipboardData(format);
	int szhglb;

	//size of the HGLOBAL
	szhglb = GlobalSize(hglb);

	//format list element
	struct formato *f = (struct formato *)malloc(sizeof(formato));

	if(hglb != NULL)
	{
		//Lock of global object
		PVOID pvoid = (PVOID) GlobalLock(hglb);

		//Allocation and copy of the format's data
		char *ft = (char *)malloc(szhglb);
		memcpy(ft,pvoid,szhglb);

		//Initialization of the format list element
		f->dim=szhglb;
		f->tipo=format;
		f->dato=ft;

		//Insert in the format list the new format
		listFormati.push_back(f);

		//Unlock sul global object
		GlobalUnlock(hglb);
	}		  
	else
	{
	//Allocation error
		MessageBox(hWnd,_T("hglb==NULL"),_T("Error"),MB_OK);
	}			
}
CloseClipboard();

GeneralRe: clipboard and file Pin
Richard MacCutchan18-Dec-11 6:01
mveRichard MacCutchan18-Dec-11 6:01 
GeneralRe: clipboard and file Pin
Member 820281618-Dec-11 7:00
Member 820281618-Dec-11 7:00 
GeneralRe: clipboard and file Pin
Richard MacCutchan18-Dec-11 9:56
mveRichard MacCutchan18-Dec-11 9:56 
QuestionSimulated press ctrl+c (copy button) any where in any window Pin
mmda17-Dec-11 4:23
mmda17-Dec-11 4:23 
AnswerRe: Simulated press ctrl+c (copy button) any where in any window Pin
Code-o-mat17-Dec-11 8:40
Code-o-mat17-Dec-11 8:40 
QuestionAn Easy Question Pin
rahul.kulshreshtha16-Dec-11 21:56
rahul.kulshreshtha16-Dec-11 21:56 
AnswerRe: An Easy Question PinPopular
Richard MacCutchan16-Dec-11 22:57
mveRichard MacCutchan16-Dec-11 22:57 
GeneralRe: An Easy Question Pin
rahul.kulshreshtha17-Dec-11 2:53
rahul.kulshreshtha17-Dec-11 2:53 
QuestionRe: An Easy Question Pin
CPallini17-Dec-11 9:35
mveCPallini17-Dec-11 9:35 
AnswerRe: An Easy Question Pin
Richard MacCutchan17-Dec-11 21:14
mveRichard MacCutchan17-Dec-11 21:14 
QuestionProcedure entry point error when using CreateProcessWithTokenW Pin
Lucidation16-Dec-11 10:20
Lucidation16-Dec-11 10:20 
AnswerRe: Procedure entry point error when using CreateProcessWithTokenW Pin
Chris Meech16-Dec-11 10:45
Chris Meech16-Dec-11 10:45 
AnswerRe: Procedure entry point error when using CreateProcessWithTokenW Pin
Randor 16-Dec-11 10:47
professional Randor 16-Dec-11 10:47 
QuestionCRecordset fails to retrieve fileds when only one record is in the recordset .SOLVED ?? Pin
Vaclav_16-Dec-11 6:30
Vaclav_16-Dec-11 6:30 
AnswerRe: CRecordset fails to retrieve fileds when only one record is in the recordset . Pin
Richard MacCutchan16-Dec-11 7:10
mveRichard MacCutchan16-Dec-11 7:10 
GeneralRe: CRecordset fails to retrieve fileds when only one record is in the recordset . Pin
Vaclav_16-Dec-11 8:15
Vaclav_16-Dec-11 8:15 
GeneralRe: CRecordset fails to retrieve fileds when only one record is in the recordset . Pin
bsdtux19-Dec-11 8:29
bsdtux19-Dec-11 8:29 

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.