R
Rob Dob
Hi,
I have a global structure that I declare within form1.cs, and I need to
reference from within other forms, everything seems to work okay at
runtime,
Everything works okay however I get the following warning when I compile:
Warning 2 Accessing a member on 'MYCMS.Form1.GLCurrentUserInfo' may cause a
runtime exception because it is a field of a marshal-by-reference class
C:\MYCMS\Form2.cs
This is my code and how/where I use it..., I'm not sure if I am using the
correct approach to storing a retreiving variables that I require
globally..,, if not I am very open to suggestions.
thanks...
I create it and make use of it in form1.cs using the folloiw code:
public struct UserInfo
{
public string userid;
public string password;
public string userlevel;
public decimal nemployeeid;
};
public UserInfo GLCurrentUserInfo;
GLCurrentUserInfo.userid = "someUserID";
then within another form, lets say form2.cs I wish to retreive then value
of it using:
Form1 oForm = (Form1)ParentForm;
this.txtAddedBy.Text = oForm.GLCurrentUserInfo.userid;
I have a global structure that I declare within form1.cs, and I need to
reference from within other forms, everything seems to work okay at
runtime,
Everything works okay however I get the following warning when I compile:
Warning 2 Accessing a member on 'MYCMS.Form1.GLCurrentUserInfo' may cause a
runtime exception because it is a field of a marshal-by-reference class
C:\MYCMS\Form2.cs
This is my code and how/where I use it..., I'm not sure if I am using the
correct approach to storing a retreiving variables that I require
globally..,, if not I am very open to suggestions.
thanks...
I create it and make use of it in form1.cs using the folloiw code:
public struct UserInfo
{
public string userid;
public string password;
public string userlevel;
public decimal nemployeeid;
};
public UserInfo GLCurrentUserInfo;
GLCurrentUserInfo.userid = "someUserID";
then within another form, lets say form2.cs I wish to retreive then value
of it using:
Form1 oForm = (Form1)ParentForm;
this.txtAddedBy.Text = oForm.GLCurrentUserInfo.userid;