|
Thanks Ben,
It helped me. My problem has been solved.
Thanks
Prakash.A
|
|
|
|
|
A AntonySP wrote: I want to know very urgently.
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."
My website
|
|
|
|
|
A AntonySP wrote: I want to know very urgently.
Please see this[^] reply.
What have you tried in the way of helping yourself? Did you google for null ints in c#[^]? Knowing how to look for answers yourself is the first step in your journey to becoming a better developer.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
A AntonySP wrote: In C# there is property NaN for Double, Single data types to store the null or empty values
Actually NaN is not intended to be used as depicted above, see
http://msdn2.microsoft.com/en-us/library/system.single.nan(VS.71).aspx[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Excellent point, and I'm kicking myself for missing that one.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Excellent point, and I'm kicking myself for missing that one.
Thank you, I'm proud to receive such a comment by you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Finding the properties for an integer is exactly the same as finding the properties for a double.
|
|
|
|
|
How can an integer have properties, as soon
as there is a period it is a double or float
|
|
|
|
|
Can anybody suggest how to convert from pdf to jpeg conversion in ASP.NET?
Please suggest ur views as soon as possible.What's logc behind that.
adil kazmi
|
|
|
|
|
adilkazmi wrote: Can anybody suggest how to convert from pdf to jpeg conversion in ASP.NET?
Yeah, you open up google and do a search ... like this:
http://www.google.co.uk/search?hl=en&q=pdf+to+jpeg+asp.net&meta=[^]
adilkazmi wrote: What's logc behind that.
Yeah I don't know what the logic behind writing
adilkazmi wrote: Please suggest ur views as soon as possible.
is either. People will respond when they can, they arn't getting paid to help you ya know :P
|
|
|
|
|
Yeah I know.
I have just mentioned that it's urgent.It doesn't mean that I am paying anyone.
Is this a way to talk to anyone??
if you or anybody doesn't want to give answers please keep silent.nobody is forcing you to give the answers.
adil kazmi
|
|
|
|
|
You have to understand that there are a lot of posts on the boards where they are urgent or must be done ASAP, etc. The simple fact is, the people on these boards volunteer their time for free and trying to hype something up like this doesn't impress them, or make them want to help any more urgently.
Please read this[^] article, especially the sections headlined "This is not a support forum" and "Replies" to understand why people react this way.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello,
how do I safely invoke a delegate on my windows form if I can't eliminate the possibility that the form gets disposed BETWEEN me checking whether it is disposed and the invoke code itself?
Randomly I'm getting an exception that says I can't access the disposed object. It's absolutely clear that I can't access a disposed object, but how do I make sure it's indeed NOT disposed if it can still get disposed right after I check whether it is disposed?
Consider this example that looks correct, but produces the above mentioned exception from time to time:
if (!MyForm.IsDisposed)
{
MyForm.Invoke(MyDelegate);
}
Form.Disposing doesn't help neither.
Thanks very much for any input,
Michal
-- modified at 7:24 Wednesday 25th July, 2007
|
|
|
|
|
It helps to set a flag that the form is closing and check for that flag before the invoke, but it's not an elegant solution and it might still throw an exception if the flag is set after checking for the flag and the form gets disposed before executing the invoke.
Any ideas?
Thanks,
Michal
|
|
|
|
|
How about wrapping both your protected override void Dispose(bool disposing) -method and your invoke-procedure in a lock(...) -block?
Ref.: http://msdn2.microsoft.com/en-us/library/c5kehkcz(vs.80).aspx
|
|
|
|
|
Cool, thanks a lot! This solutions seems to work.
Next time, I'll be wiser and will use lock for this kind of situation.
Thanks much again!!
Michal
|
|
|
|
|
are you kidding ?
the Dispose() method is the one that typically will be executed by the finalizer thread.
Do you think it will appreciate your lock ?
if the finalizer cant do its job, the GC has less memory to manage and recycle;
do you want the GC to run out of memory for no good reason ?
I am not sure what the right answer is, but what you propose seems very wrong to me.
|
|
|
|
|
Actually, it does not appreciate my lock
If I'm forcing the Dispose() to wait on the lock until all Invokes are done and until I make sure there are no Invokes going to be done in the future, I'm effectively blocking that form's Window Message Queue.
If I'm blocking the Window Message Queue, the Invoke never returns.
Obviously, the same happens (WMQ block => Invoke never returns) if I try, for instance, to block after Form.Closing event etc.
So I'm back at the beginning
Any suggestions?
Thanks,
Michal
|
|
|
|
|
I'm sure I would have some suggestions (or at least comments) if I felt I understood
your problem. You seem to somehow Dispose() of a form, while you may still need it.
So I need more info (contextual I guess).
For what it's worth: I typically dont dispose of forms, I just close them.
I realize you may want to avoid Close() so you can play with Hide() and Show() again,
but even then the last time you could Close() rather than Dispose(), couldnt you ?
|
|
|
|
|
Hi, Luc,
thanks for your comment. I'm not disposing of the form myself. I'm just closing it. But the whole point is in not allowing the form to get disposed before all possible Invokes on it are done.
I can briefly outline what is going on in my app: a server application is calling my client app every 100 ms via COM and refreshes its state. Sometimes it happens that the server stops calling my client app and I need to detect that.
For that purpose I've written a simple timer class that's started together with the app. The core class of my app stores the timestamp of the last COM call and my timer class checks every 200 ms whether the difference between DateTime.Now() and last COM call timestamp is higher than maximum allowed. If it is, it Invokes a method on a form that's telling me the connection has been lost. If it's not, it Invokes a method on a form that's telling me the connection is OK.
Obviously, the timer runs on a separate thread from the form's thread. When I'm closing the form (which does not close the application itself), I need to make sure that the timer executes the last Invoke on the form and shuts itself off.
And there's the problem. In order to make sure that the timer executes the last Invoke on the form safely, I need to prevent the form from disposing of itself before that last Invoke is done. But if I'm preventing the form from disposing of itself by putting a lock anywhere between the moment when the form starts closing and the moment when it starts getting disposed of, I'm effectively blocking the window message queue, so the last Invoke (which is executed while the form waits on a lock) never returns.
Thanks much for any help.
Michal
|
|
|
|
|
OK, so I resolved the issue. It's certainly not the most elegant solution, but it works. I will still appreciate if someone tells me how this should be done "professionally"
Instead of a lock, I'm using an ordinary while loop. The while loop has an advantage over lock of being able to execute something while it's waiting for a signal. Lock simply sits there and does nothing until the lock is released.
So I placed the while loop inside the Form.Closing() event handler. This while loop is blocking the form from closing itself (and thus disposing of itself). Inside this loop (apart from waiting for a signal) I'm executing Application.DoEvents() every 50 ms. This ensures that the Invoke, waiting on the second thread, gets processed.
If you've got some better suggestion, please tell me.
Thanks,
Michal
|
|
|
|
|
how to display group by data in gridview
and export it to excel.
example
GROUP1
CONTENT1-A CONTENT1-B
CONTENT1-A CONTENT1-B
GROUP2
CONTENT1-A CONTENT1-B
CONTENT1-A CONTENT1-B
AND EXPORT THE EXACT INTO EXCEL
kp_chat@yahoo.co.in
|
|
|
|
|
Am relatively new to asp.net and need a challenging case study. Pls send me a VSD to prepare myself for one of the best job around.
Thanks.
|
|
|
|
|
Hei U buy by your self a**hole
|
|
|
|
|
How to iterate through every cell of a datagridview?
|
|
|
|