Click here to Skip to main content
15,903,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detecting installed language pack through installshield for MFC application Pin
Cedric Moonen26-Mar-09 0:36
Cedric Moonen26-Mar-09 0:36 
QuestionHow to write a capture video data to .avi or .wmv file Pin
tns_ranjith25-Mar-09 19:11
tns_ranjith25-Mar-09 19:11 
QuestionProblem with return value of private variable within class Pin
Michael Randolph25-Mar-09 18:04
Michael Randolph25-Mar-09 18:04 
AnswerRe: Problem with return value of private variable within class Pin
Md. Ali Naser Khan25-Mar-09 18:41
Md. Ali Naser Khan25-Mar-09 18:41 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph25-Mar-09 18:57
Michael Randolph25-Mar-09 18:57 
GeneralRe: Problem with return value of private variable within class Pin
Md. Ali Naser Khan25-Mar-09 19:01
Md. Ali Naser Khan25-Mar-09 19:01 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph25-Mar-09 20:40
Michael Randolph25-Mar-09 20:40 
GeneralRe: Problem with return value of private variable within class Pin
Cedric Moonen25-Mar-09 21:14
Cedric Moonen25-Mar-09 21:14 
Michael Randolph wrote:
I thought once you instantiate the object it sets the variables that I have for parameters in the function? Where am I forgetting something? This should work as far as I can see.


I think you are seriously mistaken here: the compiler is no magic. You declare a constructor and pass two variables in that constructor. If you don't do anything with those values, the compiler won't magically assign them to your class members. That would be crazy...
You have to assign them yourself as the other poster already told you.


Michael Randolph wrote:
I thought once you instantiate the object it sets the variables that I have for parameters in the function?


Once again, the compiler is no magic, it can't guess what you want to do with the variables. What if you pass less variables than you have class members (or more) ? What if they are in different order ? In most of the cases, a class is much more than two member variables (sometimes around 100 members) and in general you pass only a few of them in the constructor. So, how will the compiler know tho which member variables he has to assign those ? That would be crazy...

Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

GeneralRe: Problem with return value of private variable within class Pin
Niklas L26-Mar-09 1:25
Niklas L26-Mar-09 1:25 
AnswerRe: Problem with return value of private variable within class Pin
Stuart Dootson25-Mar-09 23:41
professionalStuart Dootson25-Mar-09 23:41 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph26-Mar-09 19:14
Michael Randolph26-Mar-09 19:14 
GeneralRe: Problem with return value of private variable within class Pin
Stuart Dootson26-Mar-09 21:32
professionalStuart Dootson26-Mar-09 21:32 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph27-Mar-09 2:40
Michael Randolph27-Mar-09 2:40 
QuestionHow can I remove vertical scrollbar from Microsoft web browser? Pin
Md. Ali Naser Khan25-Mar-09 17:54
Md. Ali Naser Khan25-Mar-09 17:54 
AnswerRe: How can I remove vertical scrollbar from Microsoft web browser? [modified] Pin
Yajnesh Narayan Behera26-Mar-09 3:35
Yajnesh Narayan Behera26-Mar-09 3:35 
Question"game" fast fingers Pin
Aljaz11125-Mar-09 8:18
Aljaz11125-Mar-09 8:18 
AnswerRe: "game" fast fingers Pin
Cedric Moonen25-Mar-09 8:21
Cedric Moonen25-Mar-09 8:21 
GeneralRe: "game" fast fingers Pin
Aljaz11125-Mar-09 8:26
Aljaz11125-Mar-09 8:26 
JokeRe: "game" fast fingers Pin
CPallini25-Mar-09 8:30
mveCPallini25-Mar-09 8:30 
GeneralRe: "game" fast fingers Pin
Aljaz11125-Mar-09 8:40
Aljaz11125-Mar-09 8:40 
GeneralRe: "game" fast fingers Pin
CPallini25-Mar-09 8:46
mveCPallini25-Mar-09 8:46 
GeneralRe: "game" fast fingers Pin
led mike25-Mar-09 9:35
led mike25-Mar-09 9:35 
GeneralRe: "game" fast fingers Pin
CPallini25-Mar-09 9:50
mveCPallini25-Mar-09 9:50 
GeneralRe: "game" fast fingers Pin
ThatsAlok25-Mar-09 17:44
ThatsAlok25-Mar-09 17:44 
GeneralRe: "game" fast fingers Pin
Aljaz11125-Mar-09 9:45
Aljaz11125-Mar-09 9:45 

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.