Resources - Macintosh 
Author Message
 Resources - Macintosh

This doesn't work:

  Dim rf as ResourceFork
  Dim dataString as String
  Dim id as Integer
  rf=App.ResourceFork
  dataString = rf.GetResource("STR ",128)
  rf.RemoveResource("STR ",128)
  rf.AddResource("Goodbye World!","STR ",128, "Test")
  rf.close
  msgbox dataString

If I place a resource in the file manually (STR , 128) the
rf.GetResource call works fine, however, the rf.RemoveResource and
rf.AddResource have never worked.  They change nothing.

Any ideas?

--
Dave Barnes

Don't blame me, I voted with the majority...



Sat, 25 Sep 2004 05:37:23 GMT  
 Resources - Macintosh

Quote:

> This doesn't work:

>   Dim rf as ResourceFork
>   Dim dataString as String
>   Dim id as Integer
>   rf=App.ResourceFork
>   dataString = rf.GetResource("STR ",128)
>   rf.RemoveResource("STR ",128)
>   rf.AddResource("Goodbye World!","STR ",128, "Test")
>   rf.close
>   msgbox dataString

> If I place a resource in the file manually (STR , 128) the
> rf.GetResource call works fine, however, the rf.RemoveResource and
> rf.AddResource have never worked.  They change nothing.

> Any ideas?

Apps aren't allowed to manipulate their own resource fork, beyond
reading from it. Consider App.ResourceFork to be read-only.

And you should be checking rf to see if it's nil. :-)



Sat, 25 Sep 2004 06:10:06 GMT  
 Resources - Macintosh

Quote:

>   rf=App.ResourceFork

The Applications Ressourcefork?

Quote:
>   rf.RemoveResource("STR ",128)
>   rf.AddResource("Goodbye World!","STR ",128, "Test")

Go away you evil!
Changing the applications resourcefork is forbitten!

Simply forget it,

Mfg
Christian

--

Quote:
> Windows Me strzt immer wieder ab

Die ist eine Neuigkeitenverbreitungsgruppe.

http://www.christians-software.de (Kostenlose Mac/Win Software)



Sat, 25 Sep 2004 06:12:18 GMT  
 Resources - Macintosh


:> This doesn't work:
:>
:>   Dim rf as ResourceFork
:>   Dim dataString as String
:>   Dim id as Integer
:>   rf=App.ResourceFork
:>   dataString = rf.GetResource("STR ",128)
:>   rf.RemoveResource("STR ",128)
:>   rf.AddResource("Goodbye World!","STR ",128, "Test")
:>   rf.close
:>   msgbox dataString
:>
:> If I place a resource in the file manually (STR , 128) the
:> rf.GetResource call works fine, however, the rf.RemoveResource and
:> rf.AddResource have never worked.  They change nothing.
:>
:> Any ideas?

I'm pretty sure I recall that REALbasic does NOT support modification of
resources in the application itself -- only reading.

= Steve =
--
Steve W. Jackson
Montgomery, Alabama



Sat, 25 Sep 2004 06:13:23 GMT  
 Resources - Macintosh

Quote:



> :> This doesn't work:
> :>
> :>   Dim rf as ResourceFork
> :>   Dim dataString as String
> :>   Dim id as Integer
> :>   rf=App.ResourceFork
> :>   dataString = rf.GetResource("STR ",128)
> :>   rf.RemoveResource("STR ",128)
> :>   rf.AddResource("Goodbye World!","STR ",128, "Test")
> :>   rf.close
> :>   msgbox dataString
> :>
> :> If I place a resource in the file manually (STR , 128) the
> :> rf.GetResource call works fine, however, the rf.RemoveResource and
> :> rf.AddResource have never worked.  They change nothing.
> :>
> :> Any ideas?

> I'm pretty sure I recall that REALbasic does NOT support modification of
> resources in the application itself -- only reading.

> = Steve =
> --
> Steve W. Jackson
> Montgomery, Alabama

Only REALbasic? I believe all the OS, isn't it?


Wed, 29 Sep 2004 07:59:14 GMT  
 Resources - Macintosh



:>


:> >
:> > :> This doesn't work:
:> > :>
:> > :>   Dim rf as ResourceFork
:> > :>   Dim dataString as String
:> > :>   Dim id as Integer
:> > :>   rf=App.ResourceFork
:> > :>   dataString = rf.GetResource("STR ",128)
:> > :>   rf.RemoveResource("STR ",128)
:> > :>   rf.AddResource("Goodbye World!","STR ",128, "Test")
:> > :>   rf.close
:> > :>   msgbox dataString
:> > :>
:> > :> If I place a resource in the file manually (STR , 128) the
:> > :> rf.GetResource call works fine, however, the rf.RemoveResource and
:> > :> rf.AddResource have never worked.  They change nothing.
:> > :>
:> > :> Any ideas?
:> >
:> > I'm pretty sure I recall that REALbasic does NOT support modification of
:> > resources in the application itself -- only reading.
:> >
:> > = Steve =
:> > --
:> > Steve W. Jackson
:> > Montgomery, Alabama
:>
:> Only REALbasic? I believe all the OS, isn't it?
:>

In my 20+ years of developing, I've always been taught that an
application that modified itself was a very bad thing.  But I don't
think the Mac OS itself has any prohibition against this.  As far as I
know, the OS doesn't care either way if resource manipulation is done to
a running program -- it's simply a matter of REALbasic not supporting it
in its own code.

= Steve =
--
Steve W. Jackson
Montgomery, Alabama



Thu, 30 Sep 2004 07:09:26 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Resource data for Macintosh Apps?

2. Macintosh VRML Resources?!?!

3. Macintosh Tcl resources WWW page

4. Resources for ST/V macintosh 2.0

5. Resource Fork has no Resource Fork?

6. Find resources and resource name

7. Extracting Resource String from Resource Table

8. APL.68000 for Macintosh

9. APL2 on Power Macintosh screams!

10. APL for the Macintosh

11. J for Macintosh?

12. Macintosh J/APL

 

 
Powered by phpBB® Forum Software