Can't reference control variable

Hi,

I've added a control variable, as defined below:

Dialog's header file...

1
2
private:
  CString m_SourceFileName;


And in the dialog's CPP file...

1
2
3
4
5
6
void CJSCEncryptDlg::DoDataExchange(CDataExchange* pDX)
{
  CDialog::DoDataExchange(pDX);
  DDX_Text(pDX, IDC_SOURCEFILE, m_SourceFileName);
  DDV_MaxChars(pDX, m_SourceFileName, 260);;
}


When I compile the solution it raises an undeclared identifier error?!?

 
CString s = m_SourceFileName; // undeclared identifier 


What am I doing wrong. I've followed the steps found on numerous web sites, but it isn't working.

Thank you,
AJM.
where (in which file) is this line located?
CString s = m_SourceFileName;
Hi, if the dialog is called DLGEncryptG then it's in the DLGEncryptG.h file. There are several other variables defined too from my playing with the control's "Add variable" option in the painter.

Yes, I neglected to say I'm using MFC.

Thanks, AJM.
Topic archived. No new replies allowed.