S
SteveK
I will just use code, I think that will be easiest way to explain this.
public struct Something
{
public string Name;
}
private void Form1_Load(object sender, System.EventArgs e)
{
Something Userinfo = new Something();
//
// Show login dialog
//
CLoginDlg loginDlg = new CLoginDlg(ref Userinfo);
if(loginDlg.ShowDialog() == DialogResult.Cancel)
{
CAppDebug.PrintDebugWarning();
Application.Exit();
}
}
private Something m_info;
public CLoginDlg(ref Something info)
{
// Required for Windows Form Designer support
InitializeComponent();
// TODO: Add any constructor code after InitializeComponent call
m_info = info;
}
then in the CLoginDlg class I assign values to m_info, then when control
returns back to Form1_Load() the values of Userinfo are all null.
I thought that in the CLoginDlg when I was assigning values to m_info I was
assigning values to a REFERENCE of Userinfo.
Confused?... I hope this makes sense to someone
Thanks for any explanation!
Steve
public struct Something
{
public string Name;
}
private void Form1_Load(object sender, System.EventArgs e)
{
Something Userinfo = new Something();
//
// Show login dialog
//
CLoginDlg loginDlg = new CLoginDlg(ref Userinfo);
if(loginDlg.ShowDialog() == DialogResult.Cancel)
{
CAppDebug.PrintDebugWarning();
Application.Exit();
}
}
private Something m_info;
public CLoginDlg(ref Something info)
{
// Required for Windows Form Designer support
InitializeComponent();
// TODO: Add any constructor code after InitializeComponent call
m_info = info;
}
then in the CLoginDlg class I assign values to m_info, then when control
returns back to Form1_Load() the values of Userinfo are all null.
I thought that in the CLoginDlg when I was assigning values to m_info I was
assigning values to a REFERENCE of Userinfo.
Confused?... I hope this makes sense to someone

Thanks for any explanation!
Steve