Click here to Skip to main content
15,885,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Thanks, but I would like to know which SYSTEM-LEVEL functions Pin
jan larsen6-Jan-04 2:00
jan larsen6-Jan-04 2:00 
GeneralRe: Thanks, but I would like to know which SYSTEM-LEVEL functions Pin
obe6-Jan-04 8:58
obe6-Jan-04 8:58 
GeneralRe: Thanks, but I would like to know which SYSTEM-LEVEL functions Pin
jan larsen6-Jan-04 21:12
jan larsen6-Jan-04 21:12 
GeneralRe: Thanks, but I would like to know which SYSTEM-LEVEL functions Pin
obe7-Jan-04 7:34
obe7-Jan-04 7:34 
AnswerRe: What functions are there to read from files? Pin
Bob Stanneveld4-Jan-04 23:08
Bob Stanneveld4-Jan-04 23:08 
GeneralUsing PageSetup Dialog is giving memory error Pin
Anonymous4-Jan-04 10:21
Anonymous4-Jan-04 10:21 
GeneralRe: Using PageSetup Dialog is giving memory error Pin
Anonymous4-Jan-04 13:50
Anonymous4-Jan-04 13:50 
QuestionHow do I pass a value to a class? Pin
DanYELL4-Jan-04 7:17
DanYELL4-Jan-04 7:17 
I want to pass the CString name to a class. I have this:

void CForm3Page1::OnName()
{
CFormatname Dlg("ralph");
if (Dlg.DoModal() == IDOK)
{
}
}

and my class looks like this:

private:
CString thename;

public:
CFormatname(CWnd* pParent = NULL, CString); // standard constructor

CFormatname::CFormatname(CString name, CWnd* pParent /*=NULL*/)
: CDialog(name, CFormatname::IDD, pParent)
{
//{{AFX_DATA_INIT(CFormatname)
//}}AFX_DATA_INIT

thename = name;
}

But it doesn't work. I keep getting the errors:

C:\Formatname.h(25) : error C2548: 'CFormatname::CFormatname' : missing default parameter for parameter 2

C:\Formatname.h(15) : see declaration of 'CFormatname'

and other errors. I have looked in this book for quite some trying to
mimic this example. How do I pass a CString to a class?

Please any response any one can give me will be greatly appreciated.

Sincerely,
Danielle (an overworked graduate student)




AnswerRe: How do I pass a value to a class? Pin
Nick Parker4-Jan-04 8:01
protectorNick Parker4-Jan-04 8:01 
GeneralRe: How do I pass a value to a class? Pin
DanYELL4-Jan-04 8:33
DanYELL4-Jan-04 8:33 
GeneralRe: How do I pass a value to a class? Pin
Bo Hunter4-Jan-04 8:38
Bo Hunter4-Jan-04 8:38 
GeneralRe: How do I pass a value to a class? Pin
Bob Stanneveld4-Jan-04 23:16
Bob Stanneveld4-Jan-04 23:16 
AnswerRe: How do I pass a value to a class? Pin
Michael Dunn4-Jan-04 8:56
sitebuilderMichael Dunn4-Jan-04 8:56 
AnswerRe: How do I pass a value to a class? Pin
Bo Hunter4-Jan-04 9:05
Bo Hunter4-Jan-04 9:05 
GeneralRe: How do I pass a value to a class? Pin
DanYELL4-Jan-04 9:43
DanYELL4-Jan-04 9:43 
GeneralRe: How do I pass a value to a class? Pin
PJ Arends4-Jan-04 10:07
professionalPJ Arends4-Jan-04 10:07 
GeneralRe: How do I pass a value to a class? Pin
DanYELL4-Jan-04 15:04
DanYELL4-Jan-04 15:04 
GeneralRe: How do I pass a value to a class? Pin
Tim Smith4-Jan-04 15:41
Tim Smith4-Jan-04 15:41 
AnswerRe: How do I pass a value to a class? Pin
Shenthil4-Jan-04 20:52
Shenthil4-Jan-04 20:52 
Questionwhat is the definitive version of VC++ Pin
Ger Hayden4-Jan-04 7:15
Ger Hayden4-Jan-04 7:15 
AnswerRe: what is the definitive version of VC++ Pin
User 66584-Jan-04 7:58
User 66584-Jan-04 7:58 
AnswerRe: what is the definitive version of VC++ Pin
Michael Dunn4-Jan-04 8:57
sitebuilderMichael Dunn4-Jan-04 8:57 
Generalinvalid integer constant expression Pin
ABean4-Jan-04 6:47
ABean4-Jan-04 6:47 
GeneralRe: invalid integer constant expression Pin
PJ Arends4-Jan-04 10:48
professionalPJ Arends4-Jan-04 10:48 
GeneralRe: invalid integer constant expression Pin
ABean5-Jan-04 6:43
ABean5-Jan-04 6:43 

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.