mjohnson3091
Freshman
Hi all,
First of all let me say that i'm a real novice with VS2005 and mobile apps.
I've got a real problem with an application in VS2005 for Compact Framework 2 on a device running PocketPC2003.
I'll try to explain the problem....
I have a number of forms that "communicate" to a backend server through a single form (I'll call it Main for identification purposes). These other forms could be menus or function screens. On creation of each form, I create an instance member for that form and for the main form as follows:
I have a public routines in Main that will send and receive data and can be called from each other form using the instance of Main. So i can send data as below.
When a response to a send is received in main, it sends the data back to the public "ReadMessage" routine on the relevent form as follows:
So far all this works fine......
The problem I have is when I come to work with any of the controls on the form, for example a label. In the ReadMessage routine on frmMenu, if I try to write some text to a label I get the message "TextAlign = 'InspInstance.label1.TextAlign' threw an exception of type 'System.NotSupportedException' " and this seems to be the same for all labels on the form. Even though VS2005 is deploying the "Message" DLL for the device, it doesn't give me anymore specific information about the error.
When it creates the initial instance and I can write to the labels without any problems.
I hope all that made some sense to somebody.
Any suggestions/advice would be really helpful.
First of all let me say that i'm a real novice with VS2005 and mobile apps.
I've got a real problem with an application in VS2005 for Compact Framework 2 on a device running PocketPC2003.
I'll try to explain the problem....
I have a number of forms that "communicate" to a backend server through a single form (I'll call it Main for identification purposes). These other forms could be menus or function screens. On creation of each form, I create an instance member for that form and for the main form as follows:
Code:
//current instance of main form - for comms
frmMain frmMainFormInstance;
//current instance of this form - for comms
private static frmMenu InspInstance = null;
public static frmMenu Instance()
{
if (InspInstance == null)
{
InspInstance = new frmMenu ();
}
return InspInstance;
}
I have a public routines in Main that will send and receive data and can be called from each other form using the instance of Main. So i can send data as below.
Code:
private void SendMessage(string strField, string strData)
{
frmMainFormInstance.SendData(
strField + "" + Globals.cstFieldDelimiter + strData);
}
When a response to a send is received in main, it sends the data back to the public "ReadMessage" routine on the relevent form as follows:
Code:
frmMenuInstance = frmMenu .Instance();
frmMenuInstance .ReadMessage(strField, strResult, strData);
So far all this works fine......
The problem I have is when I come to work with any of the controls on the form, for example a label. In the ReadMessage routine on frmMenu, if I try to write some text to a label I get the message "TextAlign = 'InspInstance.label1.TextAlign' threw an exception of type 'System.NotSupportedException' " and this seems to be the same for all labels on the form. Even though VS2005 is deploying the "Message" DLL for the device, it doesn't give me anymore specific information about the error.
When it creates the initial instance and I can write to the labels without any problems.
I hope all that made some sense to somebody.
Any suggestions/advice would be really helpful.