🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

TTrackBar->Position not set immediately in TThread ?

#17573
From: Phuoc Can HUA
Date: Mon, 17 Mar 2003 00:10
41 lines
2377 bytes
My program ( a kind of MIDI player) allows user to move the song position by
clicking on a TrackBar. I'm passing the main form as a pointer to a TThread,
something like this:
while( !Terminated)
{     ...
    switch( ...)
    {    case A:
                MForm->TBar->Position= X;
                LogFile << X;        // For debug only
                ...
                break;
         case B:                    // Only applied after acse A (next loop)
                // Set the song position based on MForm->TBar->Position
                ....
    }
    LogFile << MForm->TBar->Position;        // For debug only
}

The program works more than 90% as expected. BUT sometimes the slider only
set on the new position for short time then the song continues at the old
position with the slider. It looks like setting the position in case A is
buffered. In next loop, case B is still using the old position to move the
playing postion. When the slider moves to the new position case B has
already set the song position (old one). That's what I'm suspecting  :-)

The fact is that log-file is showing the right value for X and the old value
for MForm->TBar->Position. The slider actually jumps to the new position
(assumed after case B).

Again, it works in most of the cases. What I'm suspecting is it possible?
and what can I do?


Phuoc Can HUA



--
_/\__/\__/\__/\__/\__/\_
www.huaonline.com
My Homepage is my Castle
Technical Details
Message-ID: <3e7513ed$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,7413c120b7a50744,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-03-16 16:24:04 PST
From: "Phuoc Can HUA" <home+a+t+huaonline.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: TTrackBar->Position not set immediately in TThread ?
Date: Mon, 17 Mar 2003 11:10:56 +1100
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 210.9.89.210
Message-ID: <3e7513ed$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1047860205 210.9.89.210 (16 Mar 2003 16:16:45 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail