|
VirtualAlloc()[^]
BTW, you already got a reply here[^] (on one of the 4 or 5 forums your posted this question )
|
|
|
|
|
Thanks toxcct,
What is the differences between HeapAlloc and VirtualAlloc? They allocate memory from different spaces?
regards,
George
|
|
|
|
|
man i'm starting to be seriously tired of your laziness.
not only you don't start to search the web before asking a forum, but you gettin me on my nerves because every thing you don't understand when someone answer you (because of your lack of knowledge), you rate it badly
I tell you, i give you this question a '1', because you HAD TO google for "HeapAlloc vs VirtualAlloc " first.
we're not here to do everything for you. you have to make the first step, and only when you're stuck on something, then you tell all the stuff you tried. not before
BTW, you never answered me how old you were since last time
|
|
|
|
|
followait wrote: VirtualAlloc is more efficient.
No, it's not (in general)! VirtualAlloc can only allocate memory in 4k chunks; if you use VirtualAlloc as a malloc replacement allocating one byte would result in wasting 4095! Part of what the code behind malloc does is carve up the memory blocks returned via VirtualAlloc to avoid this wastage. malloc also has a number of other optimisation such as a small block heap.
Steve
|
|
|
|
|
Hello Everybody.
I implemented worker thread in VC++.net2003 (MFC) as follows.
Prototype of AfxBeginThread Function
<br />
CWinThread* AfxBeginThread( AFX_THREADPROC pfnThreadProc,<br />
LPVOID pParam, int nPriority = THREAD_PRIORITY_NORMAL,<br />
UINT nStackSize = 0, DWORD dwCreateFlags = 0,<br />
LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL );
Body of Function
UINT MyThreadProc(LPVOID pParam)<br />
{<br />
if(pParam == NULL)<br />
AfxEndThread(MY_NULL_POINTER_ERROR);<br />
char *pStr = (char *) pParam;<br />
while(*pStr)<br />
*pStr++ ^= 0xA5;<br />
<br />
return 0;<br />
}
I used the Above Given code it works Fine. But what if I want to use any control of my dialog in the function.
It simply refuse to work as the following function is not member of the dialog class, hence it can not exploit any control of the dialog.
If I write this function as a member of my dialog class as follows.
UINT Myclass :: MyThreadProc(LPVOID pParam)
then the error occurs,
None of the 2 overloads can convert parameter1 to UINT(LPVOID).
Plz help me to write a function with the help of which i can use control(edit control/static control) of my dialog.
I simply want to display a counter's value in the edit control on the dialog.
and counter is being incremented in a loop in the function, that is to be used with AfxBeginThread.
|
|
|
|
|
Hello everyone,
I am thinking about the benefits of a private or protected constructor. The only benefits I could think of is we could use singleton design pattern and make a public function (e.g. CreateInstance) as a single point to create instances and hide the constructor to outside.
Any more comments?
thanks in advance,
George
|
|
|
|
|
private are just for the class it uses it, protected can be used by derived classes as well.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Thanks Nelek,
regards,
George
|
|
|
|
|
Hi all,i have opened my mainframe in the maximised view as default.but i cant open my forms maximised as default.anybody plz help me in opening my forms maximised as default.now i'm maximising it using the maximise button in that form.
Thanks in advance.
Saravana..
|
|
|
|
|
Hi,
you sould firstly (for next times) check the forum with the search option, it is probably that your question will already be answered (this one it is, I answered it a few days ago).
Nevermind, is a short thing.
Go to your CMyApp::InitInstance (), at the end of the code you should add the red code
if (!ProcessShellCommand(cmdInfo))
return FALSE;
pMainFrame->ShowWindow(m_nCmdShow | SW_SHOWMAXIMIZED );
pMainFrame->UpdateWindow();
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
|
My lecturer have send me an assignment that is about write a program of Food Ordering System. Inside the system have 4 function that important for the system, they are New Member Registration, Ordering of Food, Reload money, Balace Enquiry.
Can someone write this program for me??
|
|
|
|
|
do you want me to write
small program or big program?
|
|
|
|
|
i have done my coursework already...thx for your kindness..
i am deeply appreciate....
thanks a lot...
|
|
|
|
|
big program....
pls joke down now...
|
|
|
|
|
i had been writing that since two years.
once it is fully done i will let you know.
it is really that big.
|
|
|
|
|
yetyet wrote: Can someone write this program for me??
Right away sir. How would you like it cooked? Rare, medium or well done?
|
|
|
|
|
i have done my coursework already...thx for your kindness..
i am deeply appreciate....
thanks a lot...
|
|
|
|
|
yetyet wrote: Can someone write this program for me??
You deserve an A for honesty!
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks for your advise...
|
|
|
|
|
I want to know how can I access the registry location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrnetVersion\App Paths ? I tried to access throught the command GetSettings but it doesn't work for this location.
Any help will be Appreciated.
Sekhar
|
|
|
|
|
|
SekharOne wrote: I tried to access throught the command GetSettings...
What is GetSettings() ?
SekharOne wrote: ...but it doesn't work for this location.
Why not?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi, take a look to This thread[^] I posted some time ago, I got very good explanations about, and there are some examples.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
hello all,
i'am having 4 child form(window) in my application, and i added a combo box in the main frame tool bar. now how can i find which child form is active and based on that active form i would like to change the cursor position of combo,
can you please tell, how to do it? which function is suitable
thanks
panthal
|
|
|
|