Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC multiple groups of radio buttons Pin
Axonn Echysttas11-Oct-05 7:37
Axonn Echysttas11-Oct-05 7:37 
AnswerRe: MFC multiple groups of radio buttons Pin
David Crow11-Oct-05 9:02
David Crow11-Oct-05 9:02 
GeneralRe: MFC multiple groups of radio buttons Pin
Axonn Echysttas11-Oct-05 20:00
Axonn Echysttas11-Oct-05 20:00 
QuestionReally Urgent (Function to get the size of a file) Pin
REU11-Oct-05 7:08
REU11-Oct-05 7:08 
AnswerRe: Really Urgent (Function to get the size of a file) Pin
Chris Losinger11-Oct-05 7:18
professionalChris Losinger11-Oct-05 7:18 
GeneralRe: Really Urgent (Function to get the size of a file) Pin
REU11-Oct-05 7:28
REU11-Oct-05 7:28 
GeneralRe: Really Urgent (Function to get the size of a file) Pin
REU11-Oct-05 7:42
REU11-Oct-05 7:42 
Questionconstructor : 2 step constructor ... Pin
Maximilien11-Oct-05 6:47
Maximilien11-Oct-05 6:47 
situation : I'm converting a C struct into a C++ class.

now, I have a function AllocateC that will allocate ( malloc ) the C struct and do some initialization operations on that newly allocated struct.

MyStruct* AllocateStruct( )
{
  MyStruct* p = malloc( ... );

  // initialize struct members.
  // ...

  /// then do something ...
  DoSomething( p );
  DoSomethingElse( p );
  return p;
}


now, if I move this into a C++ class with a constructor:

MyStruct::MyStruct()
{
 // initialize the members... 
}


The problem is with the additional initialization ( DoSomething DoSomethingElse ) I think I cannot put those into the constructor because the
object is not yet finalized ( fully constructed ).

Is there a 2 step constructor "construct" that I can use, or do I have to keep using a wrapper function to do the new and the additional init.

Thanks.

Max.




Maximilien Lincourt
Your Head A Splode - Strong Bad
AnswerRe: constructor : 2 step constructor ... Pin
Prakash Nadar11-Oct-05 7:13
Prakash Nadar11-Oct-05 7:13 
QuestionGreat News! Pin
Al Baraki11-Oct-05 6:01
Al Baraki11-Oct-05 6:01 
AnswerRe: Great News! Pin
Prakash Nadar11-Oct-05 6:09
Prakash Nadar11-Oct-05 6:09 
GeneralRe: Great News! Pin
Bob Stanneveld11-Oct-05 6:28
Bob Stanneveld11-Oct-05 6:28 
AnswerRe: Great News! Pin
Maximilien11-Oct-05 6:13
Maximilien11-Oct-05 6:13 
QuestionString Help Pin
Anonymous11-Oct-05 5:59
Anonymous11-Oct-05 5:59 
QuestionRe: String Help Pin
David Crow11-Oct-05 6:06
David Crow11-Oct-05 6:06 
AnswerRe: String Help Pin
icabod11-Oct-05 6:09
icabod11-Oct-05 6:09 
AnswerRe: String Help Pin
John M. Drescher11-Oct-05 6:16
John M. Drescher11-Oct-05 6:16 
QuestionCatch program termination Pin
status()11-Oct-05 5:56
status()11-Oct-05 5:56 
QuestionConnect to Registry Pin
Mila02511-Oct-05 4:06
Mila02511-Oct-05 4:06 
AnswerRe: Connect to Registry Pin
RadioOpa11-Oct-05 4:35
RadioOpa11-Oct-05 4:35 
AnswerRe: Connect to Registry Pin
Roger Stoltz11-Oct-05 5:05
Roger Stoltz11-Oct-05 5:05 
QuestionUnicode presentation CEdit Pin
RadioOpa11-Oct-05 2:59
RadioOpa11-Oct-05 2:59 
AnswerRe: Unicode presentation CEdit Pin
RadioOpa11-Oct-05 21:17
RadioOpa11-Oct-05 21:17 
QuestionMultiByteToWideCHar Help? Pin
Amit j Patil11-Oct-05 2:35
Amit j Patil11-Oct-05 2:35 
AnswerRe: MultiByteToWideCHar Help? Pin
nm_11411-Oct-05 11:30
nm_11411-Oct-05 11:30 

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.