[futurebasic] Re: [FB] FBToC/FB5 Crash with Colorwell and _kControlContentPictHandle

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2009 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Thu, 9 Jul 2009 23:23:37 -0400
Wondering why it worked in Fb4 without supplying the PictH at same time?

That code originally came from TWM I think?

rc

On Jul 9, 2009, at 11:11 PM, Robert Purves wrote:

>
> Robert Covington wrote:
>
>> When I use this statement, with the modifier,  
>> _kControlContentPictHandle in FB5, it crashes.
>>
>> appearance button _viewTextColorWell,¬
>>                  _activeBtn,¬
>>                  ,_kControlContentPictHandle,,¬
>>                  , @gTextForeColorRect,¬
>>                  _kControlImageWellProc
>
>
> If you put _kControlContentPictHandle there, you must pass a valid  
> pictH as the preceding argument:
>   appearance button 1, _activeBtn, pictH,  
> _kControlContentPictHandle,,, @r, _kControlImageWellProc
>
>> If I install it without that constant, seems to work, the pict  
>> will install fine after with
>
>> appearance button _viewTextColorWell,¬
>>                  _activeBtn,¬
>>                  ,,,¬
>>                  , @gTextForeColorRect,¬
>>                  _kControlImageWellProc
>
>> Local Fn SetWellContents(pictH as handle,id as long )
>> dim wellInfo as ControlButtonContentInfo
>> '~';
>> wellInfo.contentType = _kControlContentPictHandle
>> #if def _FBToC
>> wellInfo.u.picture     = pictH
>> #else
>> wellInfo.picture     = pictH
>> #endif
>> def setButtondata( id,  
>> _kControlImageWellPart,_kControlImageWellContentTag, sizeof 
>> (wellInfo),@wellInfo)
>> end fn
>
> Looks OK.
>
>> I am however getting some bad memory corruption somewhere along  
>> the line that did not occur in FB4.
>
> Not obviously due to the code snippets above.
>
> Robert P.
>
> --
> To unsubscribe, send ANY message to: futurebasic- 
> unsubscribe@...
>