Click here to Skip to main content
12,075,066 members (65,666 online)

C / C++ / MFC

 
QuestionWhat is "dialog template resource"? Pin
Vaclav_Sal19-Sep-13 5:55
memberVaclav_Sal19-Sep-13 5:55 
AnswerRe: What is "dialog template resource"? Pin
pasztorpisti19-Sep-13 7:32
memberpasztorpisti19-Sep-13 7:32 
GeneralRe: What is "dialog template resource"? SOLVED Pin
Vaclav_Sal20-Sep-13 5:06
memberVaclav_Sal20-Sep-13 5:06 
GeneralRe: What is "dialog template resource"? SOLVED Pin
pasztorpisti20-Sep-13 5:31
memberpasztorpisti20-Sep-13 5:31 
GeneralRe: What is "dialog template resource"? SOLVED Pin
Vaclav_Sal20-Sep-13 6:46
memberVaclav_Sal20-Sep-13 6:46 
Questionhow to registered activex contols Pin
joshikkishore18-Sep-13 8:48
memberjoshikkishore18-Sep-13 8:48 
AnswerRe: how to registered activex contols Pin
Richard Andrew x6418-Sep-13 11:21
professionalRichard Andrew x6418-Sep-13 11:21 
AnswerRe: how to registered activex contols Pin
«_Superman_»18-Sep-13 19:35
member«_Superman_»18-Sep-13 19:35 
QuestionHow to retrive / enumerate CDialog controls Pin
Vaclav_Sal18-Sep-13 4:49
memberVaclav_Sal18-Sep-13 4:49 
AnswerRe: How to retrive / enumerate CDialog controls Pin
pasztorpisti18-Sep-13 5:22
memberpasztorpisti18-Sep-13 5:22 
GeneralRe: How to retrive / enumerate CDialog controls Pin
Vaclav_Sal18-Sep-13 8:43
memberVaclav_Sal18-Sep-13 8:43 
GeneralRe: How to retrive / enumerate CDialog controls Pin
pasztorpisti18-Sep-13 11:58
memberpasztorpisti18-Sep-13 11:58 
GeneralRe: How to retrive / enumerate CDialog controls Pin
Vaclav_Sal18-Sep-13 13:01
memberVaclav_Sal18-Sep-13 13:01 
Questionbytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 19:55
memberLe@rner17-Sep-13 19:55 
hi all,

I have file size in bytes, I am converting it in MB to display,

but or two decimal places its display round off value.

I don't want to round up the value and value should be displayed in two decimal places.

QWORD nSize=524285686;
static char szSize[16];
	if (nSize < 1024)
	{		
		sprintf(szSize, "%u Byte", nSize);
	}
	else
	{
		char szScales[] = "KMGTPEZY";
		int nScale = 0;
		for (; nScale < sizeof(szScales); ++nScale)
		{
			if (nSize < 1024 * 1024)
			{
				sprintf(szSize, "%6.2f %cB", nSize / 1024.0f, szScales[nScale]);
				break;
			}
			nSize = (nSize + 512) / 1024;
		}
		if (nScale == sizeof(szScales))
		{
			strcpy(szSize, "Unknown Size");
		}
	}
	return szSize;
 
//its return size=500.00MB
//but in real its = 499.99779319 

thanks in advance.

modified 18-Sep-13 3:18am.

AnswerRe: bytes to mb conversion upto two decimal places. Pin
Richard MacCutchan17-Sep-13 22:06
mvpRichard MacCutchan17-Sep-13 22:06 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 22:27
memberLe@rner17-Sep-13 22:27 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Richard MacCutchan17-Sep-13 22:35
mvpRichard MacCutchan17-Sep-13 22:35 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 22:38
memberLe@rner17-Sep-13 22:38 
AnswerRe: bytes to mb conversion upto two decimal places (fixed). Pin
CPallini17-Sep-13 22:47
mvpCPallini17-Sep-13 22:47 
SuggestionRe: bytes to mb conversion upto two decimal places. Pin
pasztorpisti18-Sep-13 0:21
memberpasztorpisti18-Sep-13 0:21 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
CPallini18-Sep-13 0:32
mvpCPallini18-Sep-13 0:32 
AnswerRe: bytes to mb conversion upto two decimal places. Pin
Flaviu217-Sep-13 23:19
memberFlaviu217-Sep-13 23:19 
AnswerRe: bytes to mb conversion upto two decimal places. Pin
pasztorpisti18-Sep-13 0:19
memberpasztorpisti18-Sep-13 0:19 
QuestionCreating a DLL with Web Browser Embedded Pin
Don Guy17-Sep-13 10:48
memberDon Guy17-Sep-13 10:48 
AnswerRe: Creating a DLL with Web Browser Embedded Pin
Richard Andrew x6417-Sep-13 16:34
professionalRichard Andrew x6417-Sep-13 16:34 
AnswerRe: Creating a DLL with Web Browser Embedded Pin
Richard MacCutchan17-Sep-13 22:04
mvpRichard MacCutchan17-Sep-13 22:04 
GeneralRe: Creating a DLL with Web Browser Embedded Pin
Don Guy18-Sep-13 5:15
memberDon Guy18-Sep-13 5:15 
GeneralRe: Creating a DLL with Web Browser Embedded Pin
Richard MacCutchan18-Sep-13 5:33
mvpRichard MacCutchan18-Sep-13 5:33 
GeneralRe: Creating a DLL with Web Browser Embedded Pin
Don Guy18-Sep-13 7:04
memberDon Guy18-Sep-13 7:04 
GeneralRe: Creating a DLL with Web Browser Embedded Pin
Richard MacCutchan18-Sep-13 7:31
mvpRichard MacCutchan18-Sep-13 7:31 
GeneralRe: Creating a DLL with Web Browser Embedded Pin
Don Guy18-Sep-13 7:52
memberDon Guy18-Sep-13 7:52 
GeneralRe: Creating a DLL with Web Browser Embedded Pin
Richard MacCutchan18-Sep-13 7:57
mvpRichard MacCutchan18-Sep-13 7:57 
AnswerRe: Creating a DLL with Web Browser Embedded Pin
jschell19-Sep-13 12:19
memberjschell19-Sep-13 12:19 
QuestionUnable to set focus in CPropertyPage in MFC. update solved?? Pin
Vaclav_Sal17-Sep-13 6:05
memberVaclav_Sal17-Sep-13 6:05 
QuestionRe: Unable to set focus in CPropertyPage in MFC. Pin
jeron117-Sep-13 7:27
memberjeron117-Sep-13 7:27 
AnswerRe: Unable to set focus in CPropertyPage in MFC. Pin
Vaclav_Sal17-Sep-13 8:08
memberVaclav_Sal17-Sep-13 8:08 
QuestionRe: Unable to set focus in CPropertyPage in MFC. update solved?? Pin
DavidCrow17-Sep-13 8:51
memberDavidCrow17-Sep-13 8:51 
AnswerRe: Unable to set focus in CPropertyPage in MFC. update solved?? Pin
Vaclav_Sal17-Sep-13 10:54
memberVaclav_Sal17-Sep-13 10:54 
QuestionRe: Unable to set focus in CPropertyPage in MFC. update solved?? Pin
DavidCrow18-Sep-13 3:50
memberDavidCrow18-Sep-13 3:50 
AnswerRe: Unable to set focus in CPropertyPage in MFC. update solved?? Pin
Vaclav_Sal18-Sep-13 8:50
memberVaclav_Sal18-Sep-13 8:50 
QuestionOutlook Addins Pin
john563216-Sep-13 23:55
memberjohn563216-Sep-13 23:55 
AnswerRe: Outlook Addins Pin
Richard MacCutchan17-Sep-13 1:31
mvpRichard MacCutchan17-Sep-13 1:31 
Questionhow to lock function? Pin
JoneLe8616-Sep-13 19:09
memberJoneLe8616-Sep-13 19:09 
AnswerRe: how to lock function? Pin
Richard MacCutchan16-Sep-13 21:41
mvpRichard MacCutchan16-Sep-13 21:41 
AnswerRe: how to lock function? Pin
CPallini16-Sep-13 22:18
mvpCPallini16-Sep-13 22:18 
AnswerRe: how to lock function? Pin
Freak3016-Sep-13 23:06
memberFreak3016-Sep-13 23:06 
GeneralRe: how to lock function? Pin
pasztorpisti17-Sep-13 1:27
memberpasztorpisti17-Sep-13 1:27 
QuestionWhat does it mean when...... Pin
Richard Andrew x6416-Sep-13 11:42
professionalRichard Andrew x6416-Sep-13 11:42 
AnswerRe: What does it mean when...... Pin
Graham Breach16-Sep-13 12:26
memberGraham Breach16-Sep-13 12:26 
GeneralRe: What does it mean when...... Pin
Richard Andrew x6416-Sep-13 12:51
professionalRichard Andrew x6416-Sep-13 12:51 

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.


Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 12 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid