Solved

About Constructor of CMyDiaog!

Posted on 2003-11-19
3
192 Views
Last Modified: 2013-11-20
class CDSub : public CDialog
{
// Construction
public:
      CDSub(CWnd* pParent = NULL);   // standard constructor
      CDSub(list<string > values,CWnd *pParent);
.....
}
/////////in some .cpp ,i call
......
#include "DSub.h"
#include <list>
#include <string>
using namespace std;
.....
{

 list<string > x;
   x.push_back ("f1");
   x.push_back ("f2");

   CDSub s(x,this);
   s.DoModal ();
}
there are some wrong from compiler!what can i do!
0
Comment
Question by:fyf7262284
3 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9785363
Instead of trying to do that in the constructor I would use a public function of your dialog to pass the list.

What error do you get from the compiler?
0
 
LVL 13

Accepted Solution

by:
SteH earned 20 total points
ID: 9785540
#include "DSub.h"
#include <list>
#include <string>
could be the wrong order since in DSub.h you have the declarations of your dlg class. That referrs to list and string.

try using
#include <list>
#include <string>
#include "DSub.h"
or include list and string inside DSub.h.
0
 
LVL 1

Author Comment

by:fyf7262284
ID: 9785828
thank you ! i have solved this problem!put the #nclude"DSub.h" top,and delete two line:##include <list> and #include <string>
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 136
Tab names are off by one 5 54
modThree challenge 4 90
zeroMAx challenge 20 100
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question