control programming

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

control programming

rush
Hi,

I am writing a wrapper for Scintilla text control (www.scintilla.org), and I
have progressed more or less fine with basic functionality, but I have
trouble implementing notifications reliably.

I have subclassed the ValueConvertingControlView for the Scintilla control
class, and since Scintilla is passing notification events as a structure in
Nm events, i have implemented appropriate dispatcher for scintilla
notifications. And for most of the time, my methods get called, and I am
reading values from notification structure ok. But from time to time i get
unreadable structure (for instance  some string pointer within is pointing
in the sky). It does not seem to be structure definiton problem, since in
most cases I can read the same structure ok from the same notification. So I
am running out of the simple errors, and have to suspect some more
complicated.

One thing that bugs me is that in Scintilla documentation there is
mentioning that one should not modify text while in Modify notification. I
am not doing this from my point of view, since my notification handlers are
do-nothing at the moment, but I remember reading that Dolphin VM is running
smalltalk programs on the separate thread. So is the following scenario
possible:

1) I send some modifications to the text (by sending messages to scintilla
control)
2) scintilla sends the notification
3) I send a few more changes
4) notification arrives to my smalltalk code, but the notification structure
is allready garbled

could this happen? I am not much of an expert for windows low level
programming, so please pardon me if this is complete nonsense.

Thanks,

Davorin


Reply | Threaded
Open this post in threaded view
|

Re: control programming

Blair McGlashan
"rush" <[hidden email]> wrote in message
news:a6ng7r$89rg$[hidden email]...
>
> I am writing a wrapper for Scintilla text control (www.scintilla.org), and
I
> have progressed more or less fine with basic functionality, but I have
> trouble implementing notifications reliably.
> ...
> One thing that bugs me is that in Scintilla documentation there is
> mentioning that one should not modify text while in Modify notification. I
> am not doing this from my point of view, since my notification handlers
are
> do-nothing at the moment, but I remember reading that Dolphin VM is
running
> smalltalk programs on the separate thread. So is the following scenario
> possible:
>
> 1) I send some modifications to the text (by sending messages to scintilla
> control)
> 2) scintilla sends the notification
> 3) I send a few more changes
> 4) notification arrives to my smalltalk code, but the notification
structure
> is allready garbled
>
> could this happen?...

No, at least it won't as a result of Dolphin's normal actions. Dolphin
behaves like a "normal" Windows program in that it processes notfications
from the windows synchronously. In fact this is necessary for "correct"
interaction with most Windows controls. Many of the common controls (e.g.
the ListView) have similar memory management requirements, i.e. pointers in
structures passed with notifications can only be assumed to be valid for the
duration of the call.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: control programming

rush
"Blair McGlashan" <[hidden email]> wrote in message
news:a6nqr5$fp514$1@ID-> > could this happen?...
>
> No, at least it won't as a result of Dolphin's normal actions. Dolphin
> behaves like a "normal" Windows program in that it processes notfications
> from the windows synchronously. In fact this is necessary for "correct"
> interaction with most Windows controls. Many of the common controls (e.g.
> the ListView) have similar memory management requirements, i.e. pointers
in
> structures passed with notifications can only be assumed to be valid for
the
> duration of the call.

so back to the begining of bug-quest :) ,

thanks,

Davorin