Unknown error message

  • Thread starter Thread starter SiewSa
  • Start date Start date
S

SiewSa

Dear all,

I have received the following error message that I can't figure out the
reason for that. It is happening just because of the difference of adding
one textbox. If I delete the textbox, things run correctly. However, after
I add back that textbox, the following error occured.

An unhandled exception of type 'System.NotSupportedException' occurred in
MBaroque.exe

*The error has highlighted the windows autogenerated part.
InitializeComponent()


I can confirmed that I have not repeated naming for different controls. I
am suspecting that whether there is limitation of control created or
something similar for dotnet compact framework?

Thanks for any helps!
 
The number of controls is in theory only limited on available memory. If you
are hosting a lot of controls you might run into a limitation though: Every
method in a CF application must be less that 64K of IL. Could one of these
cause your problem?

--
Regards,

Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com
 
Thanks Maarten for your help.

However, I am not too clear on the limitations yet. Right now, in order to
speed up my program, I try to make use of panels. I have put everything
into 1 form only in order to avoid the long form loading time. Am I doing
something right? Is that the reason for me to be prompted with error
messages?

You did mention that 1 method should not exceed 64K of memory. Is my form
considered as 1 method? Or, all the sub-routines underneath a form are
considered as separate methods?

Lastly, do you have any better solution for speeding up program to be
suggested to me other than the one I have above? Again, thank you very
much.
 
The limitation is per method. You can consider your form as a class
containing several methods. The one that might grow to large in your case is
InitializeComponent if you have created all of your controls, either part of
a panel or not, using the designer. Basically, if you have performance
problems, putting everything in 1 form might initially take a lot of time.
Have you seen this article?
http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfimproveformloadperf.asp.
It gives you some useful tips on optimizing the form load performance.
 
Back
Top