?
Solved

About Constructor of CMyDiaog!

Posted on 2003-11-19
3
Medium Priority
?
197 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 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

762 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