|
I don't understand the question.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
I am developing an C#.NET application in which i need to get webpage HTML data in Listview control.
|
|
|
|
|
Well, when you get your response stream, you can read from it. And you can put this data into strings and other such variables.
Then you can put these strings and whatnot into your list view.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
sunilwise wrote: its very urgent plz
Saying urgent and using textspeak doesn't really motivate people to help around here.
"I really like comments where I don't have to answer stupid questions" - stfx
|
|
|
|
|
Hi folks!
I'm having a hard time trying to explain a behaviour of one of my applications on a customer's PC.
In the app I'm using Control.BeginInvoke() to marshal a call to the main UI thread. In all of my tests, when I start my app manually (for example from a command line), this BeginInvoke call is executed within a few ms (20-90ms), everything works as expected.
On this particular customer's PC my app is being called from a third-party application (I was told they're simply using ShellExecute , as one would expect). In this case, the call to BeginInvoke() takes about 8 seconds (!). When I run the application from the command line on the customer's PC (and not have the third-party program call it), the response time is back to normal.
I don't have the faintest idea how this behaviour can be explained. Has anyone here an idea?
Thanks in advance!
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi mav, that did not ring a bell; maybe you could tell some more about what the app is
about (database, networking, WMI, whatever), and which OS your particular PC and the others
are running?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi Luc!
Thanks for your response.
The app is part of a dictation management system and is called by the other application to show a speech recognized dictation. It's using .NET remoting to communicate with a server application (running on the same machine in this case). All the PCs we're talking about are running XP SP2. The windows firewall is disabled as well as BitDefender, that has been reported (by a colleague of mine) as being installed on the customer's PC.
So nothing out of the ordinary, as far as I can tell...
I had a really vague suspicion about threadpool starvation (especially because the app is using .NET 1.1 and thus the ThreadPool is limited to 25 threads), because Control.BeginInvoke() is using a ThreadPool thread IIRC, but I cannot see how the different calling mechanisms (ShellExecute vs. command line) are supposed to influence the ThreadPool.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi Mav,
AFAIK Control.BeginInvoke() causes execution on the same thread Invoke() does: the thread on
which the Control's handle got created; that should not be a ThreadPool thread...
On the other hand, if somehow the ThreadPool is involved, then maybe this statement
holds the clue: "There is one thread pool per process. The thread pool has a default size of 25 threads per available processor".
Maybe the failing PC has fewer processors than the others?
Regards,
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
There are actually two types of BeginInvoke[^], one for controls and one for delegates.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi Tom, thanks for clarifying this. It explains how the ThreadPool may get involved...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
This may have something to do with Code Access Security[^], but I'm not positive. When using BeginInvoke, the calling thread's stack must be serialized (so the security permissions can be checked when the invoked method is actually run). If it's a single call you are having problems with, then this may not be it.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi Tom!
Thanks for your suggestion, this is one aspect I haven't checked yet.
But since all the applications are running on the same PC I didn't expect a problem with CAS. Besides - if some security permissions are not set correctly, wouldn't you expect a SecurityException instead of an 8 second delay?
But nevertheless, I'll check it tomorrow, thanks.
I'm really clutching at straws here
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
If it's running correctly then you probably have the correct permissions. I was thinking the checking of the permissions might be your issue. There are some gotchas with CAS that I do know about though (e.g. running a .Net application from a network share results in low trust).
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Also, you can try coding up another application that simply calls your application using ShellExecute. If your version runs fine, then maybe they are doing more than just calling ShellExecute.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
ReHi!
I've tried this and couldn't reproduce the problem this way. It's really wicked.
The only additional hint I got was when a VNC viewer we were using to access the particular client also started giving error messages (GDI related), so perhaps there's a general problem (HW?) with this machine.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
If it always happens when your app is started from the third-party app and never happens when your app is started directly, then I would not think it's a general problem. If it were then you would see the issue when the third-party app is not launching your app.
If this is only happening on that single box (regardless of how it was launched), then I would agree that it was a problem with the machine.
Even when launched from the third-party app, does it always take 8 seconds to execute? Are there other instances of BeginInvoke that are used?
Have you tried using perfmon (Performance Monitor) to see if your application is starving the ThreadPool? Also, can try logging the number of available threads[^]?
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hooray, at least I got a clue.
Today I got a chance to look at the machine in question and found out the reason for the delay. It was not machine-related, was not thread-pool related and could be reproduced on another machine.
The reason was/is the way the third-party app is calling our program.
They are calling ShellExecute() and then immediately enter a busy wait for 10 seconds waiting for a response file from us.
Once the timeout occurred, operation of the other app went back to normal (i.e. not cluttering the processor with busy waits) and our app finally got started.
Strangely enough, as soon as I lowered the third party app's priority, the call did come through and operation was almost normal.
I'll have to investigate further because I could then reproduce the effect with a little test application, but not if I called notepad instead of our app. Notepad opened reasonably fast. A hello world WinForms-app also took veeeery long to start up under these conditions.
But at least now I got something to work on...
Thanks for your suggestions!
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi
I m facing exception while saving an image. The code is
//this line throws Exception
picturebox.Image.Save(memorystream, System.Drawing.Imaging.ImageFormat.Jpeg );
and exception is:
"A generic error occurred in GDI+."
So plz tell me the solution
Regards
Shanzay
|
|
|
|
|
My guess is that there is something up with the memory stream.
Try saving the image to a file (by passing a string) instead of a stream. If the error still occurs, then it must be a problem with the image.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Hi,
almost all errors occuring in GDI+ lead to the same message, so it can be many things.
Most liekly in your case: you have forgotten to reposition the stream, if you write data
to a stream, its position advances; now if you want to save the image, you need to
set the position to zero again. Try memorystream.Position=0 before Image.Save
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hi,
Thanx for reply.
I did this but still getting this error.Actually I m sending Live video from server to client and after recieving every frame this error is displaying so what should I do in this Scenario.
Shanzay
|
|
|
|
|
did you succeed in saving to a file as the other reply suggested?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
yah well I got success by adding two things
1. used thread.Sleep() before saving
2. used file.jpg instead memorystream.
Thanx.
Shanzay
|
|
|
|
|
I am developing a windows application and reqiure to make POPUP Window when my application is minimized to show message what ever i want.
|
|
|
|
|
Dear dikshant,
You have to have an windows form ready as a POP UP window ...
Once you have the form ready ...
you have create an object of that form class and need to call show method of the form class object ..
here is the pseudo code for that .....
frmPopup _fPopup=new frmPopup()
_fPopup.show();
hope it helps !! :->
Thanks,
Arindam D Tewary
|
|
|
|