|
So you think a modal dialog box doesn't process WM_PAINT messages ? You think wrong.
How low can you go ? (MS retrofuck)
|
|
|
|
|
(1) Your assumption about painting in modal dialogs is wrong. Modal dialogs do receive the WM_PAINT message.
(2) As for your other issue, you can start a worker thread so that your dialog and it's controls (including this particular button of yours) will remain receptive to keyboard and mouse messages.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
hello,
I have the following problem,
float medium(float queueinput)
{
float queueout;
if ((queueinput>60)&&(queueinput<65))
queueout=(0.5/5)*(queueinput-60);
return (queueout);
}
When I execute it, it give me the warning:
"=": conversion from 'double' to 'float', possible loss of data
Does anyone know what's wrong inside it?
THX!!!
|
|
|
|
|
Numbers are double, by default. To avoid this warning, you can either disable it (#pragma warning...), or more carefully tell the compiler you are using floats : 0.5 --> 0.5f, 5 --> 5.0f, ...
How low can you go ? (MS retrofuck)
|
|
|
|
|
wong1907 wrote:
queueout=(0.5/5)*(queueinput-60);
(0.5/5) evaluates to a double-precision value, thus when multiplied bu your float, the result is a double. I usually use doubles and forget about float (I do numerical analyses that may be significant out to 20 decimal places or so). If you are set on using the smaller float, try:
float medium(float queueinput)
{
float queueout;
if ((queueinput>60)&&(queueinput<65))
queueout = static_cast < float > ((0.5/5)*(queueinput-60));
return (queueout);
}
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Any reason why you are using float instead of double ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i need to execute a dos app1, and the dos app1 executes another app2.
i want to hide app1 but not hide app2.
(normally both are visible).
i try CreateProcess function, but if hide app1, app2 is invisible also.
i have a program (no code), the program can do that, so i know it is possible, but i have no idea with the tech.
any hints and guesses will be a help.
thanks in advance
includeh10
|
|
|
|
|
|
thanks, mate,
i will try ShellExecuteEx, hope it works.
my problem is a little bit more complex than this: i need re-direction from the dos app1 also, really headache.
includeh10
|
|
|
|
|
I need two things in my C column adding function:
1. Make it so its nullable
2. Dont demand that it be a required field.
All I know right now is:
m_pTable->Columns->Append(lpstrFieldName, (enum DataTypeEnum) Type, nLength);
How can I modify this to get what I want. They are just adding a column with Append. Apparently ADOX has a column property called Nullable, but I;d have to do something like:
ColumnA.Nullable(TRUE);
But I dont know how to get the columnA. What is it that the append can tell me about the way to set the property?
|
|
|
|
|
Hi,
Is it possoble to connect any database through c++?
How is it possible.
Thanks in Advance
|
|
|
|
|
No its not possible.
Well really, yes, there are lots of ways. The most popular two are ADO and ODBC.
Now where to begin.
http://www.codeproject.com/database/caaadoclass1.asp[^]
Carlos has put together some great wrappers around ADO which is a COM based method of connecting to databases.
If your new to database programming it may be worthwhile reaing up on what ADO and ODBC are on MSDN.
|
|
|
|
|
CHAR l_buffer[4096];
...
iReturn=recv(ClientSock, l_buffer, 4096, 0);
I receive a bitmap from client but i don't receive the true data.I use this recv function. Is it right?
|
|
|
|
|
send the bitmap entierly / as u doin the same..
but make sure that all of the data u recvd in ur side
I like the dreams of the future than the history of the past.
|
|
|
|
|
how can i load a bitmap on a control which automatically changes the color (the rectangle part without the main image)as same as the current dialog color(when i change properties>>appearence tab)..
I like the dreams of the future than the history of the past.
|
|
|
|
|
first, get COLOR_BTNFACE, then use the color modify your bitmap (from buffer or on dc - best on memory dc).
it is very easy for me.
only hard thing is how to decide the "rectangle"
includeh10
|
|
|
|
|
That's strange and I needed a while to find that a CBitmap can't be stored into a vector. What can I do?
|
|
|
|
|
|
|
Hmm, what are you trying to do exactly. Have you tried a vector of pointers to CBitmap class
e.g.
std::vector<CBitmap *> v_pBitmap;
|
|
|
|
|
yes that works.... but you need to do the cleanup manualy.
I would prefer a vector of real objects, if possible. I guess a constructor or copy constructor is missing in CBitmap... anyone knows exactly why CBitmap fails?
|
|
|
|
|
Could you wrap it with an auto_ptr or something?
Yep, I can't see a copy constructor, which would go a long way to stop it from working.
|
|
|
|
|
|
Anonymous wrote:
I would prefer a vector of real objects, if possible.
it's probably "failing" because the CBitmap destructor is being called. objects in vectors may be copied and destroyed many times as a result of adding, resizing, sorting, etc.. this is simply the way they work. so, your CBitmaps are being copied and destroyed (which releases the bitmap data) simply as a rsult of adding them to the vector.
that's why you need to use pointers to objects in vectors, if the objects have any kind of memory management or external resources.
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
Thx for your help!
Chris Losinger wrote:
it's probably "failing" because the CBitmap destructor is being called.
I dont think so, ctor/dtor are empty:
_AFXWIN_INLINE CBitmap::CBitmap() { }<br />
_AFXWIN_INLINE CBitmap::~CBitmap() { }<br />
Im still suprised, a copy ctor would copy the data to another object.... so adding, resizing shouldn't be a problem. prolly not efficient, but I wonder why it has to fail with CBitmap.
Could it be that CBitmap is bad designed (missing ctor)? From the source it looks like a simple wrapper for a HBITMAP , I'm not that good in C++ and templates. I dont get why a CBitmap could not work with STL containers.
|
|
|
|