Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: modulus operator Pin
Naveen12-Jul-06 18:17
Naveen12-Jul-06 18:17 
Questionhelp useing Microsoft HTML Object Library in visual c++ 6 Pin
method00712-Jul-06 12:14
method00712-Jul-06 12:14 
AnswerRe: help useing Microsoft HTML Object Library in visual c++ 6 Pin
nguyenvhn12-Jul-06 17:32
nguyenvhn12-Jul-06 17:32 
GeneralRe: help useing Microsoft HTML Object Library in visual c++ 6 Pin
method00712-Jul-06 17:47
method00712-Jul-06 17:47 
QuestionC++ memory question Pin
mdexch12-Jul-06 11:59
mdexch12-Jul-06 11:59 
AnswerRe: C++ memory question [modified] Pin
earl12-Jul-06 13:11
earl12-Jul-06 13:11 
GeneralRe: C++ memory question Pin
mdexch14-Jul-06 7:58
mdexch14-Jul-06 7:58 
AnswerRe: C++ memory question Pin
Joe Woodbury12-Jul-06 14:11
professionalJoe Woodbury12-Jul-06 14:11 
I didn't see a leak; do note that when a heap is allocated, it may not be entirely released until the CRT deinitializes. This is not a memory leak, but an optimization.

I did see a problem with your code, though:

*pwcArray = (wchar_t**)new wchar_t*[g_I+1];<br />
ZeroMemory(*pwcArray, sizeof(wchar_t*)*g_I+1);


Note that you are allocating g_I + 1. The last item is being used as a guard item. Yet when zeroing the memory, you are zeroing out 4001 bytes (when g_I is set to 1000), not 4004. You need to wrap parenthesis around g_I + 1 as follows:

ZeroMemory(*pwcArray, sizeof(wchar_t*)*(g_I+1));

I would recommend placing the wchar_t strings in a struct with a destructor and then making the array and array of these structures (or use string or CString).

Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke

GeneralRe: C++ memory question Pin
kanduripavan12-Jul-06 20:46
kanduripavan12-Jul-06 20:46 
GeneralRe: C++ memory question Pin
Joe Woodbury13-Jul-06 0:11
professionalJoe Woodbury13-Jul-06 0:11 
Questionsscanf will only put value in first variable Pin
Evilpixie12-Jul-06 11:32
Evilpixie12-Jul-06 11:32 
AnswerRe: sscanf will only put value in first variable [modified] Pin
earl12-Jul-06 12:46
earl12-Jul-06 12:46 
GeneralRe: sscanf will only put value in first variable Pin
Evilpixie12-Jul-06 13:11
Evilpixie12-Jul-06 13:11 
GeneralRe: sscanf will only put value in first variable Pin
earl12-Jul-06 13:14
earl12-Jul-06 13:14 
GeneralRe: sscanf will only put value in first variable Pin
Evilpixie12-Jul-06 13:17
Evilpixie12-Jul-06 13:17 
AnswerRe: sscanf will only put value in first variable Pin
Stephen Hewitt12-Jul-06 14:08
Stephen Hewitt12-Jul-06 14:08 
QuestionColor management in CDC Pin
TchouTchou Project12-Jul-06 11:23
TchouTchou Project12-Jul-06 11:23 
AnswerRe: Color management in CDC Pin
A_Fa12-Jul-06 20:09
A_Fa12-Jul-06 20:09 
QuestionHow can I convert to TIFF file format? [modified] Pin
Cris12-Jul-06 9:47
Cris12-Jul-06 9:47 
AnswerRe: How can I convert to TIFF file format? Pin
Christian Graus12-Jul-06 9:55
protectorChristian Graus12-Jul-06 9:55 
AnswerRe: How can I convert to TIFF file format? Pin
Joe Woodbury12-Jul-06 10:28
professionalJoe Woodbury12-Jul-06 10:28 
GeneralRe: How can I convert to TIFF file format? Pin
Cris13-Jul-06 2:00
Cris13-Jul-06 2:00 
GeneralRe: How can I convert to TIFF file format? Pin
Joe Woodbury13-Jul-06 8:19
professionalJoe Woodbury13-Jul-06 8:19 
AnswerRe: How can I convert to TIFF file format? Pin
earl12-Jul-06 12:42
earl12-Jul-06 12:42 
GeneralRe: How can I convert to TIFF file format? Pin
Cris13-Jul-06 1:45
Cris13-Jul-06 1:45 

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.