Re: GUI update

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I don't think you'll have that file in VC6.

You can comment it out. You may have to adjust the code for any calls to
the "safe" string functions.

Mark


--
Mark Salsbery
Microsoft MVP - Visual C++


"RAN" <nijenhuis@xxxxxxx> wrote in message
news:1188244291.138688.163510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 27, 9:43 pm, RAN <nijenh...@xxxxxxx> wrote:
On Aug 27, 9:31 pm, RAN <nijenh...@xxxxxxx> wrote:





On Aug 27, 7:00 pm, Joseph M. Newcomer <newco...@xxxxxxxxxxxx> wrote:

You should not be doing such high-frequency I/O in the main GUI
thread. And you should
not be considering PeekMessage as a solution; do the I/O in a
separate thread.

You can explicitly call UpdateWindow after making modifications, but
the problem is much
deeper than just a screen update. You have a very high interaction
rate. Even if you are
using separate threads and using PostMessage to post messages to the
main GUI thread, this
means that you always have something in the message queue, since you
will be having
updates sent, on the average, every 100us (10 clients with 1ms
updates), so the WM_PAINT,
which is not sent until the queue is empty, is never sent. In
addition, given the high
data rate, there is a chance you could start losing messages. See my
essay on the use of
I/O Completion Ports to avoid this problem, on my MVP Tips site.

If you move sockets to separate threads, check out my essay on
multithreaded sockets (do
not trust the MSDN article, which is buggy beyond usability). If you
are trying to
support this data rate in a single thread, you are going to have
problems with saturating
the thread's capability to respond to user input.

Given this high data rate, and the inability of users to see anything
updating too
quickly, you might be better off just recording the values in an
array, and on a WM_TIMER
notification, perhaps 20 times a second or even less, updating the
display. (This won't
work if everything is in the main thread because you still need the
WM_PAINT, so you would
have to also call UpdateWindow). If you store the information in an
aligned DWORD, you
don't even need to synchronize the reading from and writing to the
array (except to extend
it), because the hardware will do that, and if you miss an update,
you'll catch it the
next time around.
joe

On Mon, 27 Aug 2007 09:31:04 -0700, RAN <nijenh...@xxxxxxx> wrote:
Hi,

I have a serverprogram with a CListCtrl, displaying 2 collumns with
BytesIn and BytesOut.
Those BytesIn and BytesOut represent the number of bytes comming in
and going out of the server socket. If i startup 10 clients that
connect to the server, they al send about 100 bytes of data at a 1ms
interval. The problem is that my server GUI is not getting updated,
how do i get this done? Is it something with PeekMsg() ? I dont want
to make everything threaded...

Joseph M. Newcomer [MVP]
email: newco...@xxxxxxxxxxxx
Web:http://www.flounder.com
MVP Tips:http://www.flounder.com/mvp_tips.htm

So i have to make my CAsyncSocket classes threaded for this to work,
it won't work at all whithout them i guess.
I will study your essay on threaded sockets, and hopefully i
understand it (this might be a problem for a newbie) to make my
program work the way it suppose to work. Can i download the source of
this essay somewhere ??- Hide quoted text -

- Show quoted text -

Ah, Yes i found the download link for the sources, thank you!- Hide
quoted text -

- Show quoted text -


I am using Visual C++ 6.0 Enterprise Ed.
I have downloaded the source for the threated sockets from Joseph M.
Newcomer's site and try to build it, it gives a compile error:

fatal error C1083: Cannot open include file: 'strsafe.h': No such file
or directory
Error executing cl.exe.

AsyncClient.exe - 1 error(s), 0 warning(s)

What must i do ? Do i need this file ?



.



Relevant Pages

  • Re: Problem mit Socket-Verbindung
    ... Thema mit den Sockets zu verstehen, ... Zum Beispiel ist einmal der Server ... Zum Beispiel ist im 4ten Download ... [Download .NET 2.0 Server nicht UI-blockierend.] ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Banana Republic (was Re: OpenVMS Book Wins award)
    ... client ... No bollocks HTTP, SOAP, XML, Java, Garbage ... receive messages from any number of server processes who in turn could be ... Unlike TCP/IP and/or UDP Sockets with Java that have been around since ...
    (comp.os.vms)
  • Example: Socket code (Was Re: ClientServer App)
    ... protocol, such as HTTP, as your application middleware backbone?". ... control of the server with Flash Data Management Services?" ... just enter an asterix "*" for the Queue Name and then click ... thought was to use sockets with xml-rpc but then thought there has to ...
    (comp.lang.java.programmer)
  • Re: Asynchronous socket programming vs. remoting
    ... You are the first person that said I should use sockets. ... them quicker than I can load them from my harddrive using the file system. ... It scales nice too - I tried throwing 400 requests at the server in a span ... > do not need the same assembly on the client and server. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: sockets and pipes....
    ... > I have a master process that communicates with a whole bunch of hardware ... > I've been playing with named pipes and sockets but I can't help but think ... What we did was to have an instance of a process called an Interface Server ... I would have a process waiting for each sensor (and perhaps ...
    (comp.os.linux.development.system)