Click here to Skip to main content
15,890,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString Pin
CPallini24-Aug-10 21:58
mveCPallini24-Aug-10 21:58 
GeneralRe: CString Pin
raju_shiva25-Aug-10 22:20
raju_shiva25-Aug-10 22:20 
GeneralRe: CString Pin
Shivanand Gupta25-Aug-10 8:55
Shivanand Gupta25-Aug-10 8:55 
QuestionUsing DeleteVolumeMountPoint function. Pin
dipuks24-Aug-10 11:53
dipuks24-Aug-10 11:53 
AnswerRe: Using DeleteVolumeMountPoint function. Pin
Peter_in_278024-Aug-10 13:22
professionalPeter_in_278024-Aug-10 13:22 
AnswerRe: Using DeleteVolumeMountPoint function. Pin
Sauro Viti24-Aug-10 21:11
professionalSauro Viti24-Aug-10 21:11 
GeneralRe: Using DeleteVolumeMountPoint function. Pin
dipuks25-Aug-10 2:45
dipuks25-Aug-10 2:45 
QuestionTrouble with VirtualAlloc Pin
garyflet24-Aug-10 8:30
garyflet24-Aug-10 8:30 
I'm using Visual C++ 6 service pack 6 on XP. According to the documentation for that version, Advanced Windows Extentions (AWE) allows users to access physical memory beyond the 2 GB boundary for a process. There is an example in the documentation:

http://msdn.microsoft.com/en-us/library/aa366531(VS.85).aspx

I've had trouble linking to kernel32.dll to make this work. However, the kernel32.dll(2009) in Windows/system32 has the functions so I used LoadLibrary() to explicitly link to that kernel32.dll. Unfortunately, even on a system with 2.96 GB of RAM, running ONLY the simple example, I cannot get VirtualAlloc() to successfully reserve memory over 1100 MB (it does work at 1100 MB and below). I am using the VirtualAlloc from the 2009 kernel32.dll.

*****
typedef LPVOID (WINAPI *LPVIRT)(LPVOID lpAddress,SIZE_T dwSize,DWORD flAllocationType,DWORD flProtect);
LPVIRT lpVirt;
HMODULE hHandle = LoadLibrary("kernel32.dll");

// Reserve the virtual memory.
lpVirt = (LPVIRT)GetProcAddress(hHandle, "VirtualAlloc");
lpMemReserved = (*lpVirt)( NULL,m_uMBytes*0x100000,MEM_RESERVE | MEM_PHYSICAL,PAGE_READWRITE );

if( lpMemReserved == NULL )
{
TRACE("Cannot reserve memory.\n");
return;
}
*****
With 2.96 GB, shouldn't I be able to reserve more than 1100 MB? How can I do it?
AnswerRe: Trouble with VirtualAlloc Pin
Luc Pattyn24-Aug-10 9:24
sitebuilderLuc Pattyn24-Aug-10 9:24 
GeneralRe: Trouble with VirtualAlloc Pin
garyflet24-Aug-10 10:08
garyflet24-Aug-10 10:08 
AnswerRe: Trouble with VirtualAlloc Pin
Luc Pattyn24-Aug-10 10:15
sitebuilderLuc Pattyn24-Aug-10 10:15 
AnswerRe: Trouble with VirtualAlloc Pin
norish24-Aug-10 19:24
norish24-Aug-10 19:24 
AnswerRe: Trouble with VirtualAlloc Pin
Aescleal25-Aug-10 0:55
Aescleal25-Aug-10 0:55 
QuestionMessage Removed Pin
24-Aug-10 6:19
garyflet24-Aug-10 6:19 
AnswerMessage Removed Pin
24-Aug-10 6:53
garyflet24-Aug-10 6:53 
GeneralRe: [Solved] Enabling SE_LOCK_MEMORY_NAME privilege Pin
Maximilien25-Aug-10 3:47
Maximilien25-Aug-10 3:47 
QuestionReusing an Incremented Variable within a Single Statement Pin
Skippums24-Aug-10 5:24
Skippums24-Aug-10 5:24 
AnswerRe: Reusing an Incremented Variable within a Single Statement Pin
Sauro Viti24-Aug-10 5:41
professionalSauro Viti24-Aug-10 5:41 
GeneralRe: Reusing an Incremented Variable within a Single Statement Pin
Skippums24-Aug-10 6:26
Skippums24-Aug-10 6:26 
GeneralRe: Reusing an Incremented Variable within a Single Statement Pin
norish24-Aug-10 19:30
norish24-Aug-10 19:30 
AnswerRe: Reusing an Incremented Variable within a Single Statement PinPopular
Luc Pattyn24-Aug-10 5:50
sitebuilderLuc Pattyn24-Aug-10 5:50 
GeneralRe: Reusing an Incremented Variable within a Single Statement Pin
Skippums24-Aug-10 6:15
Skippums24-Aug-10 6:15 
GeneralRe: Reusing an Incremented Variable within a Single Statement Pin
Luc Pattyn24-Aug-10 6:33
sitebuilderLuc Pattyn24-Aug-10 6:33 
GeneralRe: Reusing an Incremented Variable within a Single Statement Pin
Skippums24-Aug-10 6:54
Skippums24-Aug-10 6:54 
GeneralRe: Reusing an Incremented Variable within a Single Statement Pin
Aescleal24-Aug-10 6:42
Aescleal24-Aug-10 6:42 

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.