|
In a new atempt to solve this, I tested to create and initialize the write object in the write thread so that it doesn't exist anywhere else but in the thread and this actually seems to have solved the problem. My application no longer freezes when writing data to the GSM phone. I have not tried changing the read process yet but it should probably give the same result.
/Hampus
|
|
|
|
|
Hampus@foi wrote: Does it matter that the object I create, which is defined in the dll and is the object I use to read and write with, is not created in the tread but in the main thread?
You are kidding right? Of course that could matter if they are performing any time consuming task(s) during initialization, which it certainly sound like they are. All you would have to do is put some time elapsed code around the initialization to find out.
|
|
|
|
|
Hi,
I use C# with CsGL to build the 3D models based OpenGL.Now i want to plaint the texture with the class OpenGLTexture2D.But when i use the phrase
"private OpenGLTexture2D tex = new OpenGLTexture2D(@"text.bmp");"
to construct the class,there will report the error of
"TypeInitializationException was unhandled" in the phrase
"Application.Run(new MainForm());" in the file of Program.cs.
How can i deal with this problem? i use the vs2005 and csgl 1.4.1.0
Thanks....
|
|
|
|
|
They are probably not following guidelines and throwing exceptions from a constructor, or in this case a static constructor (as from the exception type).
|
|
|
|
|
Seems like the constructor of OpenGLTexture2D is throwing.
Split the line private OpenGLTexture2D tex = new OpenGLTexture2D(@"text.bmp");
into a member declaration without initializer,
plus an initializer statement somewhere in your code:
tex = new OpenGLTexture2D(@"text.bmp");
and put a try-catch around it, so you catch the exception and learn from all the details
Exception.ToString() holds for you.
|
|
|
|
|
|
The problem has done,tanks....

|
|
|
|
|
Just curiosity , Did anyone have idea of how many methods a single C# class can allow ?
I heard, it is compiler dependent If true, what is the maximum no allowed by the standard compiler ?
Thanks,
Vythees
|
|
|
|
|
vytheeswaran wrote: how many methods a single C# class can allow ?
We can have as we can.
For More Details:
MSDN[^]
Regards,
Satips.
|
|
|
|
|
Where does that article answer the OP's question? Or did you just chuck some keywords in to Google and hit "I'm feeling lucky"?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thanks for Info,
But I read in one article that E-Bay once hits the compiler limit in max number of methods in single class.
Thanks,
Vythees
|
|
|
|
|
IIRC ebay is running its servers using c++ and ISAPI, not .net.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
I agree, I think then there should be the same constraint exist in .NET class also.
Thanks,
Vythees
|
|
|
|
|
Even assuming there is a constraint, you're talking about 2 totally different languages so why should they be the same?
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
vytheeswaran wrote: Did anyone have idea of how many methods a single C# class can allow ?
I think that if you ever reached that limit then you might want to seriously reconsider your design.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Colin Angus Mackay wrote: I think that if you ever reached that limit then you might want to seriously reconsider your design.
or the switch/case limit or the if/elseif limit or the ....
or if none of that makes sense to you try this[^]
|
|
|
|
|
Oh God, thats classic link.
Thanks,
Vythees
|
|
|
|
|
|
Seeing Assembly metatokens takes the following form: 00 000000, where the former is the type, and the latter is the code, I would say the maximum number of methoddef's in an assembly would be limited to 24-bits, iow 16.7 million. Dunno if there is a limitation on a classes though.
|
|
|
|
|
A nice research.
Thanks,
Vythees
|
|
|
|
|
Not research, I know it from working with the spec And those values can be accessed from .NET 2 (nowadays).
|
|
|
|
|
There is a limit, I remember someone a while ago (I've got a feeling in this forum) hit a limit on the number of fields in anycase that they could include in a class. Buggered if I can remember where it was or what it was
|
|
|
|
|
Maybe you are thinking about the parameter limit, that is 16383/4.
|
|
|
|
|
No, I'm pretty sure that someone managed to hit a limit on the number of fields that could be contained in a class. I'll do some digging.
|
|
|
|
|
when in trouble, switch to Win64.
|
|
|
|