Click here to Skip to main content
15,896,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFit into the A4 Paper Pin
sdfdsfa23-Sep-03 22:46
sdfdsfa23-Sep-03 22:46 
Generala challenge Pin
harshsingh23-Sep-03 21:48
harshsingh23-Sep-03 21:48 
GeneralRe: a challenge Pin
Michael P Butler23-Sep-03 21:54
Michael P Butler23-Sep-03 21:54 
GeneralRe: a challenge Pin
harshsingh24-Sep-03 3:22
harshsingh24-Sep-03 3:22 
Generalabout overload : operate new Pin
1.5kg23-Sep-03 21:43
1.5kg23-Sep-03 21:43 
GeneralRe: about overload : operate new Pin
Joaquín M López Muñoz23-Sep-03 23:55
Joaquín M López Muñoz23-Sep-03 23:55 
GeneralRe: about overload : operate new Pin
1.5kg24-Sep-03 16:56
1.5kg24-Sep-03 16:56 
GeneralRe: about overload : operate new Pin
Joaquín M López Muñoz24-Sep-03 20:04
Joaquín M López Muñoz24-Sep-03 20:04 
OK, now I see what you are trying to do. I am afraid your idea is not realizable in C++. Overloads of new cannot have access to the object being constructed because construction takes place later. The sequence of operations performed by the compiler is
  1. Call the operator new (the default or a user-defined version) passing the size of the object to be constructed.
  2. new allocates the memory as it sees fit and returns a void *.
  3. The compiler uses this pointer to lay out the object, calling then its constructor.
So, by the time your overloaded new is called, the object does not even exist. I don't think you can workaround this.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralDevice input/output range... Pin
Manikandan23-Sep-03 21:13
Manikandan23-Sep-03 21:13 
Questionimplement resizing code on "Kodak Image Edit ActiveX Control"??? Pin
nsaadyah23-Sep-03 21:11
nsaadyah23-Sep-03 21:11 
AnswerRe: implement resizing code on "Kodak Image Edit ActiveX Control"??? Pin
Marissa18223-Sep-03 21:22
Marissa18223-Sep-03 21:22 
GeneralRe: implement resizing code on "Kodak Image Edit ActiveX Control"??? Pin
nsaadyah23-Sep-03 21:55
nsaadyah23-Sep-03 21:55 
GeneralRe: implement resizing code on "Kodak Image Edit ActiveX Control"??? Pin
Marissa18223-Sep-03 22:06
Marissa18223-Sep-03 22:06 
Generaldebug vs release Pin
Marissa18223-Sep-03 20:51
Marissa18223-Sep-03 20:51 
GeneralRe: debug vs release Pin
Abebe23-Sep-03 21:10
Abebe23-Sep-03 21:10 
GeneralRe: debug vs release Pin
Marissa18223-Sep-03 21:14
Marissa18223-Sep-03 21:14 
GeneralRe: debug vs release Pin
Abebe23-Sep-03 21:18
Abebe23-Sep-03 21:18 
GeneralRe: debug vs release Pin
Marissa18223-Sep-03 21:23
Marissa18223-Sep-03 21:23 
GeneralRe: debug vs release Pin
Michael P Butler23-Sep-03 22:00
Michael P Butler23-Sep-03 22:00 
GeneralRe: debug vs release Pin
Marissa18223-Sep-03 22:08
Marissa18223-Sep-03 22:08 
GeneralRe: debug vs release Pin
1.5kg23-Sep-03 22:02
1.5kg23-Sep-03 22:02 
GeneralRemove help button on CPropertySheet Pin
murali_utr23-Sep-03 20:27
murali_utr23-Sep-03 20:27 
GeneralTry this! Pin
Manikandan23-Sep-03 20:59
Manikandan23-Sep-03 20:59 
GeneralCProeperty Page OnOk() Pin
murali_utr23-Sep-03 23:18
murali_utr23-Sep-03 23:18 
Generalor Try this! Pin
Manikandan23-Sep-03 21:02
Manikandan23-Sep-03 21:02 

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.