|
Are you supposed to use LR_SHARED with images loaded from a file?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
When I use VC6.0,I find that:
float value=33.4;
DWORD temp=33;
value=value-(float)temp; or value=value-temp;
Then value will be 0.4 in theory. But in face it is 0.400002 in vc 6.0.
Why is it? is it a bug of VC6.0 or CPU?
|
|
|
|
|
Because,in fact,the float or double is not always preciously number when it store in the memory.
|
|
|
|
|
That's life with floating point arithmetic. Just like 1/3 can't be represented in decimal without an infinite number of decimal places not all numbers can be represented exactly in base 2 with a fixed number of binary places.
If you use double s to get more precision the answer comes to 0.39999999999999858 which is closer to the ideal.
On a sererate issue, lose the float cast: it's not needed and is bad form.
Steve
|
|
|
|
|
Hi~~~ I have a question about Clipboard.
WM_DRAWCLIPBOARD message is notified when the clipboard data is changed.
Then how do I sniff that the message of paste is sent to clipboard??
Please help~~~
C++
-- modified at 3:03 Friday 29th September, 2006
Alpha and Beta
|
|
|
|
|
I dont think it is possible as the paste operation shud be strictly b/w the paster and the pastee. As for copy and cut they are notified as the clipboard is a common data repository for all the applications and seriously i fail to understand the usage.. anyways if someone know anything about this enlighten me too!
|
|
|
|
|
What is wchar_t used for? How can I create a wchar_t string?
modified 9-Mar-17 17:09pm.
|
|
|
|
|
Daniel Kanev wrote: What is wchar_t used for
A variable of __wchar_t designates a wide-character or multibyte character type. By default wchar_t is a typedef for unsigned short.
Daniel Kanev wrote: How can I create a wchar_t string?
Use the L prefix before a character or string constant.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
wchar_t is a keyword in C++ and is used to designate wide-character type(not multibyte).
In VC7 there's an option to set whether to treat wchar_t as a built-in type or unsinged short .
-- modified at 3:53 Friday 29th September, 2006
|
|
|
|
|
fefe.wyx wrote: (not multibyte).
I Checked this out from MSDN.
The exact lines are:
A variable of __wchar_t designates a wide-character or multibyte character type. By default, wchar_t is a typedef for unsigned short;
fefe.wyx wrote: set whether to treat wchar_t as a built-in type or unsinged short.
Yes I have read about it. It's also mentioned in MSDN.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
For Example,When you want to process Chinese font,you have to chose the wchar type in your programer.
|
|
|
|
|
Daniel Kanev wrote: How can I create a wchar_t string?
The STL class wstring deals with wchar_t 's. You can use it just like you would the string class (with the wide versions of other STL classes, that is).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
|
hi,
i have a editbox control in a dialog box.
on entering the string in the editbox and clicking the button
the string have to be inserted in the listbox of the already opened other dialog box
can anybody help??
thanx in advance,
zari
|
|
|
|
|
keep a pointer of the list box in the first dialog( dialog which have the edit box). Then on pressing the button call the AddString function of that pointer.
nave
|
|
|
|
|
You may right the interface function for setting the value in the second dialog
On the button click of first dialog
{
Dlg->SetDataToListBox( m_Edit.GetWindowText()); //Where Dlg is the second dialog class object
}
In the second dialog
2ndDlg::SetDataToListBox( CString EditData ) // SetDataToListBox function the dialog class of the second dialog
{
m_ListBox.AddString( EditData );
}
Rinu Raj
|
|
|
|
|
zareee wrote: : Re: Listbox control
You can take the text of the edti box on the click of the button using the GetWindowText.
For list control you can then use CListCtrl::SetItemText()which Changes the text of a list view item or subitem.
BOOL SetItemText(
int nItem,
int nSubItem,
LPCTSTR lpszText
);
zareee wrote: string have to be inserted in the listbox
For List box you can use
CListBox::InsertString() / CListBox::AddString()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I guess zareee can insert text to listbox,right?
|
|
|
|
|
Yes...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Sorry for posting OpenGL question here.
I have not read the fine print in my OpenGL book, but can one modify
list of vertices after it is compiled?
I was hoping to do some simple animation and have build a list ( mainly cyclinders) and now need to "move it around".
Can that be done with list?
Thanks for reading.
|
|
|
|
|
u can use trasformations to move the object around.. as far as i remember from my graphics course the lists just contain the objects in precompiled form ..
|
|
|
|
|
Create glVertex objects and do whatever you want.( glTranform )
Find in GLU.h, GL.h, GLUT.h
|
|
|
|
|
Hi,
I am working on an MFC application.
if i go on execute the
ShellExecute(NULL,"open","GrDemo.exe","",NULL,SW_MAXIMIZE);
function after calling the function
CFileDialog cfd(TRUE,"dat",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"Data Files (*.dat)|*.dat|All Files (*.*)|*.*||");
ShellExecute is not working.
Please help me solving the problem.
Regards,
Pavan P
|
|
|
|
|
This happens because CFileDialog is a dialog. As the dialog pops up there is a window procedure for the dialog that takes over the control from where the dialog is called. SO the line ShellExecute is not processed until we return from the file dialog.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Did you close CFileDialog?
|
|
|
|