Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using CDHtmlDialog Pin
Don Guy2-Sep-13 6:25
Don Guy2-Sep-13 6:25 
GeneralRe: Using CDHtmlDialog Pin
Richard MacCutchan2-Sep-13 21:29
mveRichard MacCutchan2-Sep-13 21:29 
QuestionHow to write vector destructor? Pin
CryptoGnome329-Aug-13 15:36
CryptoGnome329-Aug-13 15:36 
AnswerRe: How to write vector destructor? Pin
SandipG 29-Aug-13 17:59
SandipG 29-Aug-13 17:59 
AnswerRe: How to write vector destructor? Pin
CPallini29-Aug-13 22:16
mveCPallini29-Aug-13 22:16 
AnswerRe: How to write vector destructor? Pin
Freak3029-Aug-13 22:38
Freak3029-Aug-13 22:38 
GeneralRe: How to write vector destructor? Pin
CryptoGnome330-Aug-13 5:45
CryptoGnome330-Aug-13 5:45 
GeneralRe: How to write vector destructor? Pin
Stefan_Lang2-Sep-13 0:36
Stefan_Lang2-Sep-13 0:36 
None will work for your purpose: the first and second are equivalent, and, if it is syntactically valid at all, so is the third.

The previous comment about a const reference refers to your constructor code, not the member variable declaration. I. e. you should write
C++
Grid(const vector<Points>& v) : v_points(v) {};

instead of
C++
Grid(vector<Points> v) : vector<Points>(3, 0) {};

This will initialize the member variable v_points with the exact same values that are stored in the vector v you pass as a fcuntion parameter.

If you want a constructor that initializes your vector with 3 points, you don't need the parameter v, so you only need:
C++
Grid() : v_points(3) {};

Note that these three points will be initialized by calling the default constructor for your class Point. If that constructor does not initialize it the way you want, you must change the values inside your constructor body like this:
C++
Grid() : v_points(3) {
   for (auto it_point = v_points.begin(); it_point != v_points.end(); ++it_point)
      *it_point = 0; // or whatever it takes to set the value of a Point to 0
};

QuestionHow to pass array from MFC (dialogbased) to win 32 DLL ? Pin
peoria12329-Aug-13 6:31
peoria12329-Aug-13 6:31 
AnswerRe: How to pass array from MFC (dialogbased) to win 32 DLL ? Pin
Richard Andrew x6429-Aug-13 8:33
professionalRichard Andrew x6429-Aug-13 8:33 
GeneralRe: How to pass array from MFC (dialogbased) to win 32 DLL ? Pin
peoria12329-Aug-13 11:02
peoria12329-Aug-13 11:02 
AnswerRe: How to pass array from MFC (dialogbased) to win 32 DLL ? Pin
Richard Andrew x6429-Aug-13 11:05
professionalRichard Andrew x6429-Aug-13 11:05 
AnswerRe: How to pass array from MFC (dialogbased) to win 32 DLL ? Pin
Richard MacCutchan29-Aug-13 21:06
mveRichard MacCutchan29-Aug-13 21:06 
QuestionPassing "this" pointer to Post/SendMessage Pin
Vaclav_28-Aug-13 6:12
Vaclav_28-Aug-13 6:12 
AnswerRe: Passing "this" pointer to Post/SendMessage Pin
Richard MacCutchan28-Aug-13 6:21
mveRichard MacCutchan28-Aug-13 6:21 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
Vaclav_28-Aug-13 9:04
Vaclav_28-Aug-13 9:04 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
Richard MacCutchan28-Aug-13 21:14
mveRichard MacCutchan28-Aug-13 21:14 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
Vaclav_29-Aug-13 3:54
Vaclav_29-Aug-13 3:54 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
Richard MacCutchan29-Aug-13 4:23
mveRichard MacCutchan29-Aug-13 4:23 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
Vaclav_29-Aug-13 13:03
Vaclav_29-Aug-13 13:03 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
Richard MacCutchan29-Aug-13 20:50
mveRichard MacCutchan29-Aug-13 20:50 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
pasztorpisti28-Aug-13 6:29
pasztorpisti28-Aug-13 6:29 
AnswerRe: Passing "this" pointer to Post/SendMessage SOLVED Pin
Vaclav_28-Aug-13 14:33
Vaclav_28-Aug-13 14:33 
AnswerRe: Passing "this" pointer to Post/SendMessage Pin
ThatsAlok28-Aug-13 23:41
ThatsAlok28-Aug-13 23:41 
GeneralRe: Passing "this" pointer to Post/SendMessage Pin
Vaclav_29-Aug-13 3:48
Vaclav_29-Aug-13 3:48 

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.