|
Probably lots of time is lost in finding a chunk of the wanted size. This used to be a known problem in C run time libraries, that's why many people wrote their own memory management module.
A good idea is to prepare 'pools' of predefined sizes (e.g. multiples of 8) and manage lists of vectors in each of the pools.
If your application then requests e.g. 15 bytes, you round it up to the next multiple of 8 (16 in this case) and then go to the pool of 16 bytes. If it's empty, you allocate space for e.g. 10 chunks of 16 bytes. The next time you need 16 bytes (>9, <=16), it will be much faster.
Of course you need to foresee additional list-pointers in your vector of 10 chunks of 16 bytes to store information about which chunk is already handed out to the application, which one is free, what the size is, ...
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Hi! The following values, which are greater
front = 0x003223d8
front->next = 0x00323118
Thanks, i have not clue which one is greater nor what they means! The only thing i know is that they are virtual address of a process. !!
Another thing is if i take
front->next - front
what does it give me???
Thanks
|
|
|
|
|
the numbers are too complicated: if u ask 1 and 3, which is "greater", i know the answer.
front->next - front is really meaningless except u do special research.
don't stick on those kind problems when u start to learn c++, or u will get lost.
includeh10
|
|
|
|
|
|
|
Those are hexadecimal numbers, base 16. That is what the 0x prefix means. Each digit can be 0-9 or a-f, where a-f represent decimal 10-15. So 3223d8 is less than 323118.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
How to disable the taskbar name of any process
|
|
|
|
|
suresh_sathya wrote:
How to disable the taskbar name of any process
Make the following changes in your CWinApp derived class's InitInstance() :-
m_pMainWnd->ShowWindow(SW_HIDE);
m_pMainWnd->ModifyStyleEx(WS_EX_APPWINDOW,WS_EX_TOOLWINDOW);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
The two lines in bold are the newly added lines.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
hello:
my question is: we know the modal dialog dont deal with WM_PAINT message
but when i have a button on a modal dialog to deal with a large data,how can
i refesh the dialog?i have used following code:
MSG msg;
if (!::PeekMessage(&msg.NULl,0,PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
in the for loop;but it is useless;who can tell me why?
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
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
|
|
|
|