🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Synchronization Problems....

#14416
From: Keneth Wagner
Date: Wed, 13 Aug 2003 10:06
30 lines
2210 bytes
Hi, i'm making a class where i need to wait inside a function for an event.
The problem is, this event is a Event RX from the Comm Port.  I need to read
several Messages from the port before let the funtion to continue, so i need
do something like:
//---------------------------------------------
msg GetMessage(){
    while(Not Have all the Message OR TimeOut is Reached){
        Wait.....
    }

    return CompleteMessage //Global Variable;
}
//---------------------------------------------
Event Function (Read From the Port Event){
    CompleteMessage += ReadFromtheCommPort();
}
/---------------------------------------------------------------------------
-----------------

My problem of course is a While with a ";", so i neever reach the Event
handler function and my App hang on.  I need only an IDEA because I don't
have more.

I preciate any, ANY idea.  i made it with WM_USER messages, but i need a way
to make from other application only "MyLocal = GETSOMETHING()"; where that
getsomething is a function how wait information from the port for a specific
time is gone or a message received Without hang on my app.

Thanks, and sorry if my knowlege is not much (in case all this is wrong
;-) ).
Technical Details
Message-ID: <3f3a0df1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!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,a4a10dc5e85235c0,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-13 03:09:49 PST
From: "Keneth Wagner" <keneth.wagner@peak-system.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Synchronization Problems....
Date: Wed, 13 Aug 2003 12:06:50 +0200
Lines: 32
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: 213.157.9.171
Message-ID: <3f3a0df1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1060769265 213.157.9.171 (13 Aug 2003 03:07:45 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail