Solved

About Constructor of CMyDiaog!

Posted on 2003-11-19
3
191 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
Comment Utility
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
Comment Utility
#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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 51
iSeries DB2 Query 2 82
pre4 challenge 19 87
withoutTen challenge 14 85
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now