Click here to Skip to main content
15,888,802 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: crash in memory heap allocation - windows 7 - Unicode project Pin
Erudite_Eric22-Dec-11 0:14
Erudite_Eric22-Dec-11 0:14 
AnswerRe: crash in memory heap allocation - windows 7 - Unicode project Pin
Chuck O'Toole22-Dec-11 4:26
Chuck O'Toole22-Dec-11 4:26 
AnswerRe: crash in memory heap allocation - windows 7 - Unicode project Pin
Albert Holguin22-Dec-11 5:21
professionalAlbert Holguin22-Dec-11 5:21 
Questionabout DLL dependencies Pin
ryan218921-Dec-11 5:37
ryan218921-Dec-11 5:37 
AnswerRe: about DLL dependencies Pin
Richard Andrew x6422-Dec-11 10:10
professionalRichard Andrew x6422-Dec-11 10:10 
AnswerRe: about DLL dependencies Pin
Lactoferrin22-Dec-11 21:14
Lactoferrin22-Dec-11 21:14 
Questioncalling a function multple times, clears previous values Pin
jkirkerx20-Dec-11 17:14
professionaljkirkerx20-Dec-11 17:14 
AnswerRe: calling a function multple times, clears previous values Pin
Richard MacCutchan20-Dec-11 21:46
mveRichard MacCutchan20-Dec-11 21:46 
I'm not sure where this code actually exists as you have not shown where in the function it is, or really what it is trying to do. however when you allocate a buffer with a new operator it creates a new buffer every time you pass that line of code (you should also delete[] them when finished with). If you want some permanent buffer then you should allocate it outside the function and pass it in as a reference on the function call. Something like:
C++
int myfunc(buffer* pszBuffer)
{
// fill buffer with information
    return 1;
}

char* nbuff = new char[64];
int val = myfunc(nbuff);
// do other things
delete[] nbuff; // finished with this buffer

Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman



GeneralRe: calling a function multple times, clears previous values Pin
jkirkerx21-Dec-11 6:16
professionaljkirkerx21-Dec-11 6:16 
QuestionRe: calling a function multple times, clears previous values Pin
David Crow21-Dec-11 2:38
David Crow21-Dec-11 2:38 
AnswerRe: calling a function multple times, clears previous values Pin
jkirkerx21-Dec-11 6:23
professionaljkirkerx21-Dec-11 6:23 
AnswerRe: calling a function multple times, clears previous values Pin
David Crow21-Dec-11 7:54
David Crow21-Dec-11 7:54 
GeneralRe: calling a function multple times, clears previous values Pin
jkirkerx21-Dec-11 8:15
professionaljkirkerx21-Dec-11 8:15 
GeneralMuch better now Pin
jkirkerx23-Dec-11 12:48
professionaljkirkerx23-Dec-11 12:48 
Question16 bit C Compiler Pin
softwaremonkey19-Dec-11 23:40
softwaremonkey19-Dec-11 23:40 
AnswerRe: 16 bit C Compiler Pin
CPallini19-Dec-11 23:55
mveCPallini19-Dec-11 23:55 
AnswerRe: 16 bit C Compiler Pin
User 742933820-Dec-11 8:12
professionalUser 742933820-Dec-11 8:12 
GeneralRe: 16 bit C Compiler Pin
softwaremonkey20-Dec-11 8:23
softwaremonkey20-Dec-11 8:23 
GeneralRe: 16 bit C Compiler Pin
Richard MacCutchan20-Dec-11 21:40
mveRichard MacCutchan20-Dec-11 21:40 
GeneralRe: 16 bit C Compiler Pin
Richard Andrew x6422-Dec-11 10:24
professionalRichard Andrew x6422-Dec-11 10:24 
GeneralRe: 16 bit C Compiler Pin
softwaremonkey23-Dec-11 5:34
softwaremonkey23-Dec-11 5:34 
GeneralRe: 16 bit C Compiler Pin
Richard Andrew x6423-Dec-11 6:40
professionalRichard Andrew x6423-Dec-11 6:40 
AnswerRe: 16 bit C Compiler Pin
Software_Developer20-Dec-11 8:30
Software_Developer20-Dec-11 8:30 
GeneralRe: 16 bit C Compiler Pin
softwaremonkey23-Dec-11 5:57
softwaremonkey23-Dec-11 5:57 
QuestionDependencies for Visual STudio8 Pin
MKC00219-Dec-11 19:09
MKC00219-Dec-11 19:09 

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.