Click here to Skip to main content
16,018,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Desiging in C Pin
CPallini20-Jan-15 5:09
mveCPallini20-Jan-15 5:09 
GeneralRe: Desiging in C Pin
Albert Holguin20-Jan-15 6:52
professionalAlbert Holguin20-Jan-15 6:52 
SuggestionRe: Desiging in C Pin
David Crow20-Jan-15 4:06
David Crow20-Jan-15 4:06 
AnswerRe: Desiging in C Pin
Richard MacCutchan20-Jan-15 5:42
mveRichard MacCutchan20-Jan-15 5:42 
QuestionAdding a second recent file list to the MFC ribbon bar Pin
Leif Simon Goodwin19-Jan-15 23:18
Leif Simon Goodwin19-Jan-15 23:18 
AnswerRe: Adding a second recent file list to the MFC ribbon bar Pin
Leif Simon Goodwin23-Jan-15 0:23
Leif Simon Goodwin23-Jan-15 0:23 
GeneralRe: Adding a second recent file list to the MFC ribbon bar Pin
Leif Simon Goodwin25-Jan-15 22:45
Leif Simon Goodwin25-Jan-15 22:45 
QuestionC++ class initialization Pin
Vaclav_19-Jan-15 14:32
Vaclav_19-Jan-15 14:32 
I would like to get better grasp on how C++ class is instantiated / initialized.
Here is a part of what I assume relevant code I like to have help with.
The USBHost class has a method "Task" which is basically a state machine and I am currently trying to figure out how is this state machine "advanced".
Before I can get to that I need better understanding how is the class initialized.
I have put my basic questions as comments to this code snippet.
If someone can also apply descriptive terminology and / or explain the syntax it would be nice, but nothing elaborate.
Appreciate your time.
Thanks
Vaclav

static uint32_t usb_error = 0; // is (global) static initialized to 0 as default anyway?
static uint32_t usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE; // this state is not defined as 0 - this is OK

/**
* \brief USBHost class constructor.
*/
USBHost::USBHost() : bmHubPre(0) // may be a default USB hub 0 , not sure
{
usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE; // why "initialized " again here?

init();
}

/**
* \brief Initialize USBHost class.
*/
void USBHost::init()
{
devConfigIndex = 0; // USB (device ?) default index
bmHubPre = 0; // is this necessary? see constructor parameter
}
AnswerRe: C++ class initialization Pin
Jochen Arndt19-Jan-15 21:18
professionalJochen Arndt19-Jan-15 21:18 
GeneralRe: C++ class initialization Pin
David A. Gray8-Apr-15 20:25
David A. Gray8-Apr-15 20:25 
GeneralRe: C++ class initialization Pin
Jochen Arndt8-Apr-15 20:51
professionalJochen Arndt8-Apr-15 20:51 
GeneralRe: C++ class initialization Pin
David A. Gray9-Apr-15 11:05
David A. Gray9-Apr-15 11:05 
AnswerRe: C++ class initialization Pin
CPallini20-Jan-15 1:52
mveCPallini20-Jan-15 1:52 
AnswerRe: C++ class initialization Pin
Albert Holguin20-Jan-15 4:40
professionalAlbert Holguin20-Jan-15 4:40 
GeneralRe: C++ class initialization Pin
Vaclav_20-Jan-15 6:22
Vaclav_20-Jan-15 6:22 
GeneralRe: C++ class initialization Pin
Albert Holguin20-Jan-15 6:50
professionalAlbert Holguin20-Jan-15 6:50 
GeneralRe: C++ class initialization Pin
Vaclav_20-Jan-15 16:43
Vaclav_20-Jan-15 16:43 
GeneralRe: C++ class initialization Pin
Albert Holguin21-Jan-15 3:14
professionalAlbert Holguin21-Jan-15 3:14 
GeneralRe: C++ class initialization Pin
Vaclav_21-Jan-15 16:00
Vaclav_21-Jan-15 16:00 
GeneralRe: C++ class initialization Pin
CPallini20-Jan-15 7:56
mveCPallini20-Jan-15 7:56 
GeneralRe: C++ class initialization Pin
Albert Holguin20-Jan-15 8:05
professionalAlbert Holguin20-Jan-15 8:05 
GeneralRe: C++ class initialization Pin
CPallini20-Jan-15 9:14
mveCPallini20-Jan-15 9:14 
GeneralRe: C++ class initialization Pin
Albert Holguin20-Jan-15 9:57
professionalAlbert Holguin20-Jan-15 9:57 
GeneralRe: C++ class initialization Pin
CPallini20-Jan-15 10:26
mveCPallini20-Jan-15 10:26 
General[SOLVED] Re: C++ class initialization Pin
Vaclav_22-Jan-15 8:00
Vaclav_22-Jan-15 8:00 

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.