Click here to Skip to main content
15,890,123 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Problem in C++ Template definition [modified] Pin
Stuart Dootson14-Oct-09 6:19
professionalStuart Dootson14-Oct-09 6:19 
QuestionCreating a Status Bar in DialogBased Application Pin
Hari_1614-Oct-09 3:49
Hari_1614-Oct-09 3:49 
AnswerRe: Creating a Status Bar in DialogBased Application Pin
Roger Stoltz14-Oct-09 4:47
Roger Stoltz14-Oct-09 4:47 
AnswerRe: Creating a Status Bar in DialogBased Application Pin
David Crow14-Oct-09 7:52
David Crow14-Oct-09 7:52 
GeneralRe: Creating a Status Bar in DialogBased Application Pin
Hari_1614-Oct-09 18:01
Hari_1614-Oct-09 18:01 
GeneralRe: Creating a Status Bar in DialogBased Application Pin
David Crow15-Oct-09 3:09
David Crow15-Oct-09 3:09 
QuestionHow to convert real to binary Pin
Aljaz11114-Oct-09 3:09
Aljaz11114-Oct-09 3:09 
AnswerRe: How to convert real to binary Pin
Iain Clarke, Warrior Programmer14-Oct-09 3:22
Iain Clarke, Warrior Programmer14-Oct-09 3:22 
You need to do a bit or research.

How you convert it depends on what you want to do with the end result.

You can have fixed point binary fractions... So, first bunch of bits are the whole number, last bunch are (eg 8 bits) are 256ths. This is quite common in motor controllers, as it makes their fractions into slightly hard integers.

Or you can have a moving "binary" point, so the fraction is represented as: 1.xxxxx * 2^yyyy.
The 1. is not needed to be stored, as it always exists. How many bits you put to xxx's and how many to yyy's is variable. These are called mantissa and exponent, so have fun googling!

Try this:

float d = 1;
BYTE *by = (BYTE*)(&d);
d = 2;
d = 1.1;
d = 1.00001;

Now look at the memory d is stored in (using your debugger) and see how it changes when you put these different numbers in.

Short answer to your question: However you like!

Iain.

I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

AnswerRe: How to convert real to binary Pin
Cedric Moonen14-Oct-09 4:18
Cedric Moonen14-Oct-09 4:18 
AnswerRe: How to convert real to binary Pin
CPallini14-Oct-09 5:05
mveCPallini14-Oct-09 5:05 
GeneralRe: How to convert real to binary Pin
Aljaz11114-Oct-09 6:26
Aljaz11114-Oct-09 6:26 
GeneralRe: How to convert real to binary Pin
Ozer Karaagac14-Oct-09 15:54
professionalOzer Karaagac14-Oct-09 15:54 
GeneralRe: How to convert real to binary Pin
Luc Pattyn14-Oct-09 16:18
sitebuilderLuc Pattyn14-Oct-09 16:18 
GeneralRe: How to convert real to binary Pin
Patcher3214-Oct-09 17:59
Patcher3214-Oct-09 17:59 
QuestionOpen an associated file using doubleclick while application is running Pin
Erik14-Oct-09 2:22
Erik14-Oct-09 2:22 
QuestionRe: Open an associated file using doubleclick while application is running Pin
David Crow14-Oct-09 2:27
David Crow14-Oct-09 2:27 
AnswerRe: Open an associated file using doubleclick while application is running Pin
Erik14-Oct-09 18:17
Erik14-Oct-09 18:17 
GeneralRe: Open an associated file using doubleclick while application is running Pin
David Crow15-Oct-09 3:07
David Crow15-Oct-09 3:07 
AnswerRe: Open an associated file using doubleclick while application is running Pin
Iain Clarke, Warrior Programmer14-Oct-09 3:31
Iain Clarke, Warrior Programmer14-Oct-09 3:31 
QuestionDisconnection of LAN cable abruptly Pin
nvshree8714-Oct-09 1:49
nvshree8714-Oct-09 1:49 
AnswerRe: Disconnection of LAN cable abruptly Pin
Moak14-Oct-09 9:56
Moak14-Oct-09 9:56 
QuestionChanging Default Icon in MFC Pin
Hari_1614-Oct-09 1:31
Hari_1614-Oct-09 1:31 
AnswerRe: Changing Default Icon in MFC Pin
Game-point14-Oct-09 1:41
Game-point14-Oct-09 1:41 
GeneralRe: Changing Default Icon in MFC Pin
Hari_1614-Oct-09 1:54
Hari_1614-Oct-09 1:54 
AnswerRe: Changing Default Icon in MFC Pin
CPallini14-Oct-09 1:54
mveCPallini14-Oct-09 1:54 

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.