Click here to Skip to main content
15,905,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how can I draw large Images in WIN 95? Pin
www.fengyuan.com31-Aug-00 14:27
susswww.fengyuan.com31-Aug-00 14:27 
GeneralWindow from resource Pin
Erik31-Aug-00 4:50
Erik31-Aug-00 4:50 
GeneralRe: Window from resource Pin
Erik Funkenbusch31-Aug-00 12:17
Erik Funkenbusch31-Aug-00 12:17 
GeneralTab key is not working in OCX control -- URGENT Pin
Abdul Kareem31-Aug-00 4:49
Abdul Kareem31-Aug-00 4:49 
GeneralRe: Tab key is not working in OCX control -- URGENT Pin
Igor Chouvalov31-Aug-00 6:07
Igor Chouvalov31-Aug-00 6:07 
GeneralRe: Tab key is not working in OCX control -- URGENT Pin
Abdul Kareem31-Aug-00 7:27
Abdul Kareem31-Aug-00 7:27 
GeneralICommandWithParameters implementation code Pin
hongdongsuk31-Aug-00 0:58
hongdongsuk31-Aug-00 0:58 
Generaloverriding new/delete Pin
Walter Gildersleeve30-Aug-00 21:24
Walter Gildersleeve30-Aug-00 21:24 
I've posted this question on other sites/BBSs w/o success...

So I'm trying to write custom new and delete functions, in order to find a bunch of memory leaks in a program I'm working on. (This is in MSVC 6.) My new function I've defined as follows:

void *__cdecl operator new(size_t, debug_class);

I invoke it with

char* ptr = new (debug_class()) char[10];

my custom routine then storing appropriate info. This works fine. But for this to work correctly, I need to have a matching delete routine. I've tried something similar, defining it as so:

void __cdecl operator delete(void*, debug_class);

But how do I invoke it? I've tried several possibilities, to whit

delete (debug_class()) ptr[];
delete (debug_class(), ptr);
delete (ptr, debug_class());

etc., but mainly end up with compiler errors. The last example compiles fine, but calls the default delete operator nonetheless. Any ideas how I'd invoke it? TIA

Walter Gildersleeve
IVU-Umwelt GmbH
Freiburg, Germany





GeneralRe: overriding new/delete Pin
Tim Deveaux31-Aug-00 14:00
Tim Deveaux31-Aug-00 14:00 
GeneralRe: overriding new/delete Pin
Tim Deveaux3-Sep-00 3:49
Tim Deveaux3-Sep-00 3:49 
GeneralVB / VC++ question Pin
Danny30-Aug-00 21:17
Danny30-Aug-00 21:17 
GeneralRe: VB / VC++ question Pin
HP31-Aug-00 1:07
HP31-Aug-00 1:07 
GeneralRe: VB / VC++ question Pin
jschacker1-Sep-00 10:45
jschacker1-Sep-00 10:45 
GeneralGet Binary TimeZone Info from Registry Pin
Lynda Brenock30-Aug-00 19:39
sussLynda Brenock30-Aug-00 19:39 
GeneralRe: Get Binary TimeZone Info from Registry Pin
HP31-Aug-00 1:00
HP31-Aug-00 1:00 
GeneralRe: Get Binary TimeZone Info from Registry Pin
lynda31-Aug-00 12:04
lynda31-Aug-00 12:04 
GeneralHyperlink Pin
Eq30-Aug-00 18:04
Eq30-Aug-00 18:04 
GeneralRe: Hyperlink Pin
Oleg Zhuk30-Aug-00 22:53
Oleg Zhuk30-Aug-00 22:53 
Generalannoying button border Pin
philippe dykmans29-Aug-00 0:16
philippe dykmans29-Aug-00 0:16 
GeneralRe: annoying button border Pin
philippe dykmans30-Aug-00 23:53
philippe dykmans30-Aug-00 23:53 
Generaltree controls in unicode... Pin
lauren28-Aug-00 21:03
lauren28-Aug-00 21:03 
GeneralCursor pointer color Pin
sunny28-Aug-00 15:54
sunny28-Aug-00 15:54 
GeneralRe: Cursor pointer color Pin
Ezz Khayyat29-Aug-00 3:46
professionalEzz Khayyat29-Aug-00 3:46 
General*** Retriving Rows of Data from Access Tables ** Pin
Steve Lai28-Aug-00 15:40
Steve Lai28-Aug-00 15:40 
GeneralRe: *** Retriving Rows of Data from Access Tables ** Pin
lauren28-Aug-00 21:07
lauren28-Aug-00 21:07 

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.