[futurebasic] Re: [FB] CFRange and CFRangeMake

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

From: Bernie <fblist.bw@...>
Date: Sat, 14 Jul 2007 18:07:08 +0100
On 14 Jul 2007, at 17:55, Ken Shmidheiser wrote:

> Do know how to load a handle to a block of text into a  
> CFMutableStringRef?


Ken,

I'm not real clever with handles, pointers and all that jazz, but  
maybe you can mess around with this:

//---------------
include "Tlbx CarbonEvents.incl"

toolbox fn CFStringCreateWithBytes( CFAllocatorRef alloc, const UInt8  
*bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean  
isExternalRepresentation ) = CFStringRef

dim as Str255 s
dim as CFStringRef string

s = "'Twas brillig, and... all that stuff"
string = fn CFStringCreateWithBytes( 0, @s[1], s[0],  
_kCFStringEncodingMacRoman, _false )
if ( string ) then CFShow(string)

RunApplicationEventLoop()
//---------------


Bernie