🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10531

User Interface Thread

#10531
From: p Anders
Date: Thu, 01 Apr 2004 20:02
19 lines
2115 bytes
How do I invoke the my applications main thread (the user interface thread)
to update the state of objects contained on a form without worrying about
data synchronization issues?
Can windows messages be sent to a standard c++ class that doesn't derived
from something like TObject?

I have a set of classes that define a "framework" for creating a certain
type of program.  I have a "data manager" where the state of the objects on
a deived form will be stored.  I will receive data over the network and,
when it arrives, I need to update the derived form by invoking a method.
This method is called in a different thread than the user interface thread
and I am concerned that a user manipulating the application, along with
trying to update the GUI with the arriving data, could cause some data
corruption if both the user interface thread and my receiving data thread
try to update the GUI at the same time.  I thought If I used a windows
message to notify my base classes then it can go get the data from the data
manager and update the derived forms from within the user interface thread.

Does this make any sense?  I'm trying to explain this as clearly as I can.
Technical Details
Message-ID: <406c756d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,3efebec5b7748a04,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-01 12:10:16 PST
Reply-To: "p Anders" <paul.anderson@jhuapl.edu>
From: "p Anders" <paul.anderson@jhuapl.edu>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: User Interface Thread
Date: Thu, 1 Apr 2004 15:02:54 -0500
Lines: 23
Organization: JHU/APL
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 128.244.21.78
Message-ID: <406c756d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1080849773 128.244.21.78 (1 Apr 2004 12:02:53 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail