Click here to Skip to main content
15,910,411 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Link list Using STL Pin
itkid28-Oct-05 6:46
itkid28-Oct-05 6:46 
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 
VirtualLock

The VirtualLock function locks the specified region of the process's virtual address space into physical memory, ensuring that subsequent access to the region will not incur a page fault.


BOOL VirtualLock(
LPVOID lpAddress,
SIZE_T dwSize
);


Locking pages into memory may degrade the performance of the system by reducing the available RAM and forcing the system to swap out other critical pages to the paging file. Each version of Windows has a limit on the maximum number of pages a process can lock. This limit is intentionally small to avoid severe performance degradation. Applications that need to lock larger numbers of pages must first call the SetProcessWorkingSetSize function to increase their minimum and maximum working set sizes. The maximum number of pages that a process can lock is equal to the number of pages in its minimum working set minus a small overhead.

Pages that a process has locked remain in physical memory until the process unlocks them or terminates.

To unlock a region of locked pages, use the VirtualUnlock function. Locked pages are automatically unlocked when the process terminates.


If memory was allocated with HeapAlloc, you can use VirtualQueryEx to get an appropriate start address.
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 
AnswerRe: Forcing an allocated Heap to physical memory & 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 

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.