|
Floating-point numbers are not stored in memory exactly as you might think. There is always a precision concern when storing a floating-point number in a binary computer. The float type only has 6-7 digits of precision, while the double type has 15-16 digits of precision. See the following MSDN articles for more: Q36068 and Q125056.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
|
Does anyone of you know what AFX stands for?
|
|
|
|
|
|
Great! Thank you!
I'm what you'd call newbie in the subject -- for the time being
-- modified at 6:39 Thursday 26th January, 2006
|
|
|
|
|
I love this..
Since Microsoft was only a budding monopoly then, Borland had OWL which was better than AFX at the time.
And if we had OWL for 32-bits, it would STILL be better than MFC/AFX
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
|
hai everyone..is it possible to do voice with visual C++?. Let say, when user started to using a my application, i want the application pop-up together with voice, for example "welcome to my software( in voice )"
|
|
|
|
|
You can use the PlaySound[^] function from the multimedia SDK. Of course, you have first to record your welcome message yourself (or use an existing one).
|
|
|
|
|
Thanks for your fast feedback. I alredy record my welcome message, but my problems now is how i want to add the record to my C++ application. Got any application sample or article?..i will appreciate your help.
|
|
|
|
|
Did you bother reading the link I gave you in my previous post ??
|
|
|
|
|
Maybe off-topic, since I do not know what kind of application you are working on, but if you do something like that, do not forget to provide an option to deactivate it. Seems like a cool feature the first three times you use the software, but can become really annoying.
~RaGE();
|
|
|
|
|
nevermind, thats a good idea.thanks for remind me. Do you got any sample or article that i can refer how can i add the record into my application?..thanks
-- modified at 20:43 Thursday 26th January, 2006
|
|
|
|
|
Insert the Microsoft Agent Activex control (agentctl.dll) into your project and then you can use code like:
CAgentCtlCharacters m_AgentCharacters;
CAgentCtlCharacterEx m_AgentCharacter;
...
m_AgentCharacters = m_agent.GetCharacters();
m_AgentCharacters.Load("Robby", _variant_t("robby.acs"));
m_AgentCharacter = m_AgentCharacters.Character("Robby");
m_AgentCharacter.Show(_variant_t());
m_AgentCharacter.Speak(_variant_t("My name is Robby. What is your name?"), _variant_t());
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi,
How do we change the color of the button?
Thanks,
Wax
|
|
|
|
|
You will need to implement an ownerdrawn button, if you need to change the appearance such as the face colour. Try one of the many button controls[^] thats here at CodeProject.
I Dream of Absolute Zero
|
|
|
|
|
Handle the WM_CTLCOLORBTN notification message in the parent window of the button.
Steve
|
|
|
|
|
Stephen Hewitt wrote: Handle the WM_CTLCOLORBTN notification message in the parent window of the button.
This won't work.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I tried it just then and you are correct, it doesn't work. A more careful read of the documentation (as you often find yourself doing when stuff won't work) reveals the following:
"only owner-drawn buttons respond to the parent window processing this message".
Steve
|
|
|
|
|
Stephen Hewitt wrote: I tried it just then and you are correct, it doesn't work
Even I kept trying for sometime.
What puzzles me is that what purpose does it accomplish?
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I found myself wondering the same thing.
Steve
|
|
|
|
|
Respected All
Regards!
i developed aclass of printing, it works fine but the print did not come on the middle of the page,that's start from the TOP LEFT margine of the page,plz mentioned the changes so that i may able to get the print on the center of the page.
Thanks n advance.
David
david
|
|
|
|
|
Following the "brute force and pig-ignorance" approach, I do the following to print an image (C code, but it should give the idea):
iPageX = GetDeviceCaps (hdcPrn, HORZRES) ;
iPageY = GetDeviceCaps (hdcPrn, VERTRES) ;
iTopMargin = iPageY / 10;
iLeftMargin = iPageX / 10;
iPageX = iPageX - iLeftMargin - iLeftMargin;
iPageY = iPageY - iTopMargin - iTopMargin;
StretchDIBits(hdcPrn, iLeftMargin, iTopMargin, iPageX , iPageY,
0, 0, iImageMaxX, iImageMaxY, lvpBits, lpBitMapHeader,
DIB_RGB_COLORS, SRCCOPY);
I hope I haven't missed any relevant steps!
|
|
|
|
|
hi
how should i handle keystrokes in a dialog???
i handle them with PreTranslateMessage() but it seems that it handles a single keystroke for example twice or more! so the code executes more than once. what should i do??
i do sth like this:
PreTanslateMessage(MSG*msg)
{
switch(msg->wpraram)
{
case VK_UP:
//do the code
}
}
but the code executes more than once
|
|
|
|
|
In most cases handling them in PreTranslate message is unusual. If you want to however the code should look something like this:
<br />
PreTanslateMessage(MSG*msg)<br />
{<br />
if ( msg->message == WM_CHAR )<br />
{<br />
switch(msg->wpraram)<br />
{<br />
case VK_UP:<br />
}<br />
}<br />
}<br />
Steve
|
|
|
|