From: tom.koschate@rose.com (tom koschate)
Subject: Re: Digitalk ST/V-PM:
Organization: Rose Media Inc, Toronto, Ontario.
Date: Sun, 16 Aug 1992 22:17:19 GMT
X-Gated-By: Usenet <==> RoseMail Gateway (v1.70)


Date Entered: 08-16-92 17:08
M(>From: marten@feki.toppoint.de (Marten Feldtmann)
M(>Newsgroups: comp.lang.smalltalk
M(>Subject: Re: Digitalk ST/V-PM: more problems?!
M(>Message-ID: <713898828snx@feki.toppoint.de>
M(>X-Gated-By: Usenet <==> RoseMail Gateway (v1.70)
M(>Date: Sat, 15 Aug 92 17:13:48 GMT
M(>Organization: Private Site
M(>Lines: 20
M(>
M(>Another nice way to crash ST-V/PM 1.4 with OS/2 2.0  (at least on my s
M(>
M(>               1 to: 500 do: [ :anIndex | 
M(>                   Transcript show: (anIndex printString) ; cr ]
M(>
M(>The machine is a 486/33, 16MB ... perhaps it's a timing problem, becau
M(>the number at which ST-V/Pm crashes is not always the same.
M(>
M(>It always produces an illegal access error within the library "PMMLE.D
M(>
M(>Can someone confirm this?

Sorry, it causes no problem for me.  Try this fix that is part of a 
group posted on Compu$erve by Digitalk:

2)    Writing to OS/2 2.0 MLE very quickly can cause crash.

When running VPM 1.4 or 1.3 under OS/2 2.0, a crash can occur when writing
text very quickly to a MultiLineEdit Field, such as is used in TextWindow
and TextPane.  The problem is related to calls to PMWindowLibrary which 
are re-entrant in to Smalltalk.  A fix to method TextEdit>>insert: will 
solve the crashing problem.   (Note:  TextPaneClassic is not affected by 
this problem, as it is not based on MLE.)

Here's the fixed method with the relevant lines marked with asterisks:

!TextEdit methods !  
insert: aString
        "Insert aString at current location replacing
        selection if present."
    | answer a |  " *** "
    handle isValid ifTrue: [
        ((aString basicSize > MaxBufferSize) 
        or: [aString includes: 0 asCharacter])
            ifTrue: [self import: aString]
            ifFalse: [
                answer := (PMLong usingBytes: (PMWindowLibrary            
                    sendMsg: handle
                    msg: MlmInsert

                    mp1: ( a := PMAddress
                           copyToNonSmalltalkMemory: aString asParameter)
                           asParameter  " *** "

                    mp2: 0)) asInteger.

                    a free.  " *** "

                (answer = 0 and: [aString size > (MaxBufferSize // 2)])   
                    ifTrue: [
                         " Apparent limitation of MLE - cannot handle     
                         lines longer than 32765 bytes (and it does not   
                         warn us with a WM_COMMAND message),              
                         so assume that if the answer is zero and         
                         the string is long, that must be what happened   
                         and truncate the string and try again."          
                         
                         self insert: (aString copyFrom: 1 
                                       to: MaxBufferSize // 2), '...']]]
    ifFalse: [
        value isNil ifTrue: [ value := OrderedCollection new ].
        value add: aString ].!    !


--- WinQwk 1.30 #0
---
   RoseMail 2.00 : RoseNet<=>Usenet Gateway : Rose Media 416-733-2285