Click here to Skip to main content
15,920,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAssertion in ctlreg.cpp (OLE Registration) Pin
SatyaDY28-Oct-05 3:50
SatyaDY28-Oct-05 3:50 
QuestionInternet Explorer Toolbar Pin
Mircea Grelus28-Oct-05 3:03
Mircea Grelus28-Oct-05 3:03 
QuestionForcing an allocated Heap to physical memory & not to be swaped to the page file. Pin
ja100128-Oct-05 2:48
ja100128-Oct-05 2:48 
AnswerRe: Forcing an allocated Heap to physical memory & not to be swaped to the page file. Pin
David Crow28-Oct-05 3:04
David Crow28-Oct-05 3:04 
AnswerRe: Forcing an allocated Heap to physical memory & not to be swaped to the page file. Pin
Cedric Moonen28-Oct-05 3:13
Cedric Moonen28-Oct-05 3:13 
AnswerRe: Forcing an allocated Heap to physical memory & not to be swaped to the page file. Pin
Michael Dunn28-Oct-05 3:24
sitebuilderMichael Dunn28-Oct-05 3:24 
AnswerRe: Forcing an allocated Heap to physical memory & not to be swaped to the page file. Pin
Blake Miller28-Oct-05 7:32
Blake Miller28-Oct-05 7:32 
QuestionRe: Forcing an allocated Heap to physical memory & not to be swaped to the page file. Pin
ja100129-Oct-05 4:49
ja100129-Oct-05 4:49 
This is what I did and the VirtualQueryEX() returend 0 and nothing in the struct.
What am I doing wrong?

void main(int argc, char *argv[])<br />
{<br />
    DWORD  dwMin, dwMax;<br />
    HANDLE hProcess;<br />
    _MEMORY_BASIC_INFORMATION MemInfo; <br />
<br />
    //Creating the heap<br />
    HANDLE hHeap = HeapCreate(NULL, 1024 * 1024 *20, 1024 * 1024 * 30);<br />
	<br />
	hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, GetCurrentProcessId());<br />
    if (hProcess == INVALID_HANDLE_VALUE)<br />
    {<br />
        printf( "OpenProcess failed (%d)\n", GetLastError() );<br />
        return;<br />
    }<br />
    if (SetProcessWorkingSetSize(GetCurrentProcess(), 1024 * 1024 *20, 1024 * 1024 *30) != 0)<br />
    {<br />
	printf("Process Size Set!\n");<br />
    }<br />
    else<br />
    {<br />
	printf("Error in seting the Process Size!\n");<br />
    }<br />
    printf("%d\n",VirtualQueryEx(hProcess, hHeap, &MemInfo , 1024 * 1024 *20));<br />
    printf("\n MemoryRegionSize: %d\n", MemInfo.RegionSize);<br />
	<br />
    if (VirtualLock(MemInfo.BaseAddress, MemInfo.RegionSize) != 0)<br />
    {<br />
	printf("Virtual Lock Success!!!\n");<br />
    }<br />
    else<br />
    {<br />
	printf("Virtual Lock Failed!!!\n");<br />
    }	<br />
    CloseHandle(hProcess);<br />
}


HELP?!?!
AnswerRe: Forcing an allocated Heap to physical memory &amp; not to be swaped to the page file. Pin
Blake Miller31-Oct-05 3:21
Blake Miller31-Oct-05 3:21 
QuestionHow to debug an api call that generates an unknown error Pin
Dan Neely28-Oct-05 2:09
Dan Neely28-Oct-05 2:09 
Questionneed help in TrimStart() Pin
sheshidar28-Oct-05 1:58
sheshidar28-Oct-05 1:58 
AnswerRe: need help in TrimStart() Pin
willy_total28-Oct-05 2:23
willy_total28-Oct-05 2:23 
GeneralRe: need help in TrimStart() Pin
sheshidar28-Oct-05 3:22
sheshidar28-Oct-05 3:22 
GeneralRe: need help in TrimStart() Pin
willy_total31-Oct-05 2:58
willy_total31-Oct-05 2:58 
AnswerRe: need help in TrimStart() Pin
shivditya28-Oct-05 2:52
shivditya28-Oct-05 2:52 
QuestionMessage Pumps in MFC Pin
Eytukan28-Oct-05 1:02
Eytukan28-Oct-05 1:02 
AnswerRe: Message Pumps in MFC Pin
David Crow28-Oct-05 2:54
David Crow28-Oct-05 2:54 
GeneralRe: Message Pumps in MFC Pin
Eytukan28-Oct-05 4:21
Eytukan28-Oct-05 4:21 
GeneralRe: Message Pumps in MFC Pin
Eytukan28-Oct-05 4:23
Eytukan28-Oct-05 4:23 
GeneralRe: Message Pumps in MFC Pin
David Crow28-Oct-05 4:48
David Crow28-Oct-05 4:48 
GeneralRe: Message Pumps in MFC Pin
Eytukan28-Oct-05 5:51
Eytukan28-Oct-05 5:51 
GeneralRe: Message Pumps in MFC Pin
David Crow28-Oct-05 6:16
David Crow28-Oct-05 6:16 
Questioncaret position from ms word Pin
sudeesh28-Oct-05 0:23
sudeesh28-Oct-05 0:23 
QuestionWritePrinter Code to Test Pin
AsimUmair28-Oct-05 0:13
AsimUmair28-Oct-05 0:13 
QuestionUsing CDO in VC6 how to send email Pin
naeemnimi27-Oct-05 23:46
naeemnimi27-Oct-05 23:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.