Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: try/catch Pin
James R. Twine7-Nov-01 15:08
James R. Twine7-Nov-01 15:08 
GeneralADO in MFC Pin
2-Nov-01 12:02
suss2-Nov-01 12:02 
GeneralRe: ADO in MFC Pin
Christian Graus2-Nov-01 20:46
protectorChristian Graus2-Nov-01 20:46 
GeneralRe: ADO in MFC Pin
5-Nov-01 14:51
suss5-Nov-01 14:51 
GeneralSystemParametersInfo Fails under WindowsXP... Pin
Joshua Guy2-Nov-01 10:40
Joshua Guy2-Nov-01 10:40 
QuestionIs there a memory limit for the "new" operator? Pin
clintsinger2-Nov-01 9:57
clintsinger2-Nov-01 9:57 
AnswerRe: Is there a memory limit for the "new" operator? Pin
Xian2-Nov-01 12:54
Xian2-Nov-01 12:54 
AnswerTry this... Pin
2-Nov-01 19:05
suss2-Nov-01 19:05 
I'm not sure if this coincide with what you need...

I needed a buffer for file manipulation. The "new" seemed to be limited to 64k of memory. A work around this uses structures. Declare a structure with elements (in my case, BYTE) as array of size 0xff (65,535). If you need more than 64k of memory, declare more array of BYTE's. In order to use it, declare a variable of the structure and a pointer to BYTE. Then point the pointer to the first element of the structure, and voila!, you have a buffer array of more than 64k! Just use the pointer to access the buffer. (elements declared in a structure are allocated continously).

Note: if elements are of size 0xff each, I noticed that one can not have more than 16 elements. Ofcourse, I might be wrong.

typedef struct BUFFER {
BYTE Buffer0 [0xff];
BYTE Buffer1 [0xff];
...
BYTE BufferN [0xff];
} BUFFER;

void Some_Function ()
{
BUFFER Buffer;
BYTE *pBuffer;

pBuffer = Buffer.Buffer0;

memset (pBuffer, 0, <size_of_the total="" array="" of="" buffer="">);
...
}
Smile | :)
GeneralRe: Try this... Pin
Anders Molin3-Nov-01 6:31
professionalAnders Molin3-Nov-01 6:31 
GeneralRe: Try this... Pin
clintsinger5-Nov-01 9:18
clintsinger5-Nov-01 9:18 
GeneralRe: Try this... Pin
Anders Molin5-Nov-01 9:47
professionalAnders Molin5-Nov-01 9:47 
GeneralMFC Bitmaps..... Pin
2-Nov-01 7:06
suss2-Nov-01 7:06 
GeneralRe: MFC Bitmaps..... Pin
Christian Graus2-Nov-01 20:50
protectorChristian Graus2-Nov-01 20:50 
Generalstring and CString Pin
2-Nov-01 7:01
suss2-Nov-01 7:01 
GeneralRe: string and CString Pin
2-Nov-01 7:07
suss2-Nov-01 7:07 
GeneralRe: string and CString Pin
2-Nov-01 7:16
suss2-Nov-01 7:16 
QuestionHow to keep time limit in the program? Pin
Kant2-Nov-01 6:28
Kant2-Nov-01 6:28 
AnswerRe: How to keep time limit in the program? Pin
CMFC6.0VS.NETUser2-Nov-01 6:51
CMFC6.0VS.NETUser2-Nov-01 6:51 
GeneralRe: How to keep serial number logic in the program? Pin
Kant2-Nov-01 8:19
Kant2-Nov-01 8:19 
GeneralRe: How to keep serial number logic in the program? Pin
Nish Nishant2-Nov-01 8:23
sitebuilderNish Nishant2-Nov-01 8:23 
GeneralRe: How to keep serial number logic in the program? Pin
Anders Molin3-Nov-01 6:35
professionalAnders Molin3-Nov-01 6:35 
GeneralRe: How to keep serial number logic in the program? Pin
3-Nov-01 11:43
suss3-Nov-01 11:43 
GeneralMaking Sure VC ATL Events are shown in VB Pin
Tim Rymer2-Nov-01 5:59
Tim Rymer2-Nov-01 5:59 
GeneralRe: Making Sure VC ATL Events are shown in VB Pin
Bill Wilson2-Nov-01 14:00
Bill Wilson2-Nov-01 14:00 
GeneralTree Control Pin
Peter Liddle2-Nov-01 5:27
Peter Liddle2-Nov-01 5:27 

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.