[futurebasic] Re: [FB] Append a String to the Clipboard in Carbon

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2002 : Group Archive : Group : All Groups

From: RICH LOVE <richlove@...>
Date: Sun, 16 Jun 2002 08:03:24 -0500
I'd like to stick with the container version since it does not have the 32K
limit. If someone knows why it crashes under OS 9, I would appreciate
knowing about it since it might show up in OS X eventually?

Rich Love - Carnation Software
  Terminal emulations for Macintosh - MacWise, MacToPic Plus and SBMac.
  Email Checker, Carnation Desktop Pictures, Desktop Screen Saver,
  Index & Shutdown, One Touch Scan and QuitAll
  Visit our home page at http://www.carnation-software.com
  512 858-9234


> From: Ken Shmidheiser <k.shmidheiser@...>
> Reply-To: futurebasic@...
> Date: Sun, 16 Jun 2002 06:48:12 -0400
> To: futurebasic@...
> Subject: Re: [FB] Append a String to the Clipboard in Carbon
> 
> Alain, posting some very solid clipboard code, said:
> 
>> RICH LOVE wrote:
>>> 
>>>  Ken,
>>> 
>>>  That works great!
>>>  Thanks very much.
>>>  FYI, it works under OS X (which is all I need) but crashes when booted
>>> under
>>>  OS 9 saying it is out of memory trying to dispose a handle.
>>> 
>> I don't know about your crash, but I got a memory problem related to
>> container with the code posted by Ken under Mac OS 9.2.2. I have not
>> tried to find the cause of the trouble, instead I have used the
>> original program to test another approach without the use of containers.
>> 
>> While containers may be handy, I don't like that much to be forced to
>> add global variables in my programs. I always try to keep them at the
>> minimum. Not that containers variables would eat too much memory space
>> but it is also slightly more difficult to reuse the functions in other
>> projects if they refer to containers.
>> I think it is a good habit to build self contained functions in local
>> mode. You can see the benefits as soon as you start a new project.
>> 
>> It is also a good habit whenever possible to free the memory allocated
>> in the same function you have asked for it. I saw that Ken didn't do
>> that. It is OK in very short demos, but in real projects you might
>> easily loose tracks on what is going on with memory.
>> 
>> Here is my hack of Ken's code (not tested under OS X):
> 
> ---- code snipped ------
> 
> Alain,
> 
> Thanks for the modifications. They undoubtedly will be more stable
> than the rough demo I posted, particularly in the areas of memory
> allocation and error checking.
> 
> Let me give a little rationale for my experiment with containers:
> 
> As jonathan noted earlier in this thread,  the OS X clipboard is a
> complicated beast capable of holding an assorted array of data
> flavors.
> 
> Your approach is solid based on long-standing FB tradition, but it
> relies on edit fields and ZTEXT which automatically limit the scrap
> to 32k, and to text-only clips.
> 
> It strikes me that in the world of OS X, where anything from QT video
> to PDF files may be on the clipboard, we need to begin exploring
> other methods to massage larger scrap sizes of assorted flavors. The
> container approach may not be the best-- or even viable-- but I'm
> used to stumbling around in the dark.
> 
> As always, thanks for your valuable insights and elegant code. I'm
> learning more each day.
> 
> Ken
> 
> 
> 
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>
> 
>