[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

About Constructor of CMyDiaog!

Posted on 2003-11-19
3
Medium Priority
?
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 45

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 40 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

649 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