
11-11-2008, 08:15 AM
|
| Junior Member | | Join Date: Sep 2009
Posts: 0
| |
Re: How to know when a container update is finished On 11/10/08 10:35 pm, Steven Levine wrote:
>
>> By adding a DosSleep(1) between the inserts and query I resolved the
>>timing issue but it seems like a very weak solution.
>
> Are you sure that the CM_QUERYRECORDRECT return was bogus, or just not the
> final value. It's not unusual for an individual record's position to
> change multiple times during a large container update.
>
The coordinate values were always the same meaningless values. I got the
idea of a delay because inserting extra logging or pause-for-the-cause
dialogs returned correct values. And no error values were returned in any
case; the bogus and correct returns both claimed the function executed
properly.
> In the general case there's no way to know if a container update is done.
> There might be unprocessed messages in the queue.
>
Bugger.
> Without really knowing why you are using CM_QUERYRECORDRECT when you are,
> it occurs to me that perhaps whatever you are doing should be done in the
> CN_EMPHASIS handler.
>
A set of messages is maintained separate from the window. Part of the
data is the RECORDCORE structure. When a folder is selected for viewing,
the set is scanned for selected records; the first selected (CRA_SELECTED)
item is remembered. After sending the CM_INSERTRECORDARRAY, the remembered
record is queried for its position so the container can be scrolled to
bring it into view.
I vaguely recall trying to do the same in CN_EMPHASIS with a similar
result of getting bad position data.
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email) |