Click here to Skip to main content
15,913,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple File Input Pin
Jordan C. Atlas8-Jan-05 8:45
Jordan C. Atlas8-Jan-05 8:45 
GeneralCrystal Report Pin
javad_20007-Jan-05 10:31
javad_20007-Jan-05 10:31 
GeneralRe: Crystal Report Pin
Michael P Butler7-Jan-05 11:27
Michael P Butler7-Jan-05 11:27 
Generaldc.DrawText() doesn't work?! Pin
rh0057-Jan-05 10:04
rh0057-Jan-05 10:04 
GeneralRe: dc.DrawText() doesn't work?! Pin
PJ Arends7-Jan-05 10:20
professionalPJ Arends7-Jan-05 10:20 
GeneralUsing Winsocks Select() function. Pin
jerry1211a7-Jan-05 8:39
jerry1211a7-Jan-05 8:39 
GeneralRe: Using Winsocks Select() function. Pin
User 66587-Jan-05 12:25
User 66587-Jan-05 12:25 
GeneralReporting malloc problem with _malloc_dbg question. Pin
Maximilien7-Jan-05 8:08
Maximilien7-Jan-05 8:08 
When using _malloc_dbg( size, _NORMAL_BLOCK, __FILE__, __LINE__ ), it reports a memory problem if the memory is not freed.

now, if I have a function that wraps malloc ( and _malloc_dbg ), the line reported by _malloc_dbg will be inside that wrapper function; and not from where that wrapper was called.


//pseudo-code
void* MyMalloc( int size )
{
  void* p = NULL;
...
#if _DEBUG
  p = _malloc_dbg( size, _NORMAL_BLOCK, __FILE__, __LINE__  ); 
#else
  p = malloc( size );
...
  return p;
}


Is there an easier way to have __FILE__ and __LINE__ from the caller without having to create a different wrapper for the debug and release versions ?

Now, I have #define in my code that will either call _malloc_dbg or my own wrapper.

I hope it's clear enough.

Thanks.

Max.



Maximilien Lincourt
Your Head A Splode - Strong Bad
GeneralRe: Reporting malloc problem with _malloc_dbg question. Pin
PJ Arends7-Jan-05 10:13
professionalPJ Arends7-Jan-05 10:13 
GeneralRe: Reporting malloc problem with _malloc_dbg question. Pin
Maximilien7-Jan-05 13:56
Maximilien7-Jan-05 13:56 
QuestionIdentifying multiple instances of a program? Pin
Member 16322377-Jan-05 8:07
Member 16322377-Jan-05 8:07 
AnswerRe: Identifying multiple instances of a program? Pin
Maximilien7-Jan-05 8:17
Maximilien7-Jan-05 8:17 
AnswerRe: Identifying multiple instances of a program? Pin
PJ Arends7-Jan-05 8:21
professionalPJ Arends7-Jan-05 8:21 
GeneralCDC and BItmap question Pin
Maverick7-Jan-05 7:25
Maverick7-Jan-05 7:25 
GeneralRe: CDC and BItmap question Pin
PJ Arends7-Jan-05 9:13
professionalPJ Arends7-Jan-05 9:13 
GeneralRe: CDC and BItmap question Pin
Maverick7-Jan-05 15:36
Maverick7-Jan-05 15:36 
GeneralSynchronization with CTypedPtrArray Pin
Konrad Windszus7-Jan-05 7:24
Konrad Windszus7-Jan-05 7:24 
GeneralRe: Synchronization with CTypedPtrArray Pin
Ravi Bhavnani7-Jan-05 14:44
professionalRavi Bhavnani7-Jan-05 14:44 
GeneralSelecting last line of text in my View class Pin
7-Jan-05 6:59
suss7-Jan-05 6:59 
GeneralCurious about the file sort order Pin
LiYS7-Jan-05 5:46
LiYS7-Jan-05 5:46 
GeneralConvert PDF files into EMF Pin
smile86917-Jan-05 5:11
smile86917-Jan-05 5:11 
GeneralRe: Convert PDF files into EMF Pin
basementman7-Jan-05 7:09
basementman7-Jan-05 7:09 
GeneralRead single bit from a file Pin
Nitron7-Jan-05 4:57
Nitron7-Jan-05 4:57 
GeneralRe: Read single bit from a file Pin
Graham Bradshaw7-Jan-05 5:25
Graham Bradshaw7-Jan-05 5:25 
GeneralRe: Read single bit from a file Pin
Nitron7-Jan-05 5:27
Nitron7-Jan-05 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.