Resourcefork help 
Author Message
 Resourcefork help

I have a resources in my project.There are 2 pict in it, id 128 and id
129.Can i change the content of this pict?
I try addpicture myima,129,"" but don't work
How can i do that?
thanx


Sun, 28 Sep 2003 15:42:27 GMT  
 Resourcefork help

11/4/01 8:42 am:

Quote:
> I have a resources in my project.There are 2 pict in it, id 128 and id
> 129.Can i change the content of this pict?
> I try addpicture myima,129,"" but don't work
> How can i do that?
> thanx

Hi,

I don't think you can for some reason, I've just tried to do it myself but
with no results. Why are you trying to put a different picture into your
apps resource fork? If its for preferences, put a prefs file in the
preferences folder and add the picture to its resourcefork.

Hope this helps :-)

-------------------------
Chris Willis

-------------------------



Sun, 28 Sep 2003 22:23:44 GMT  
 Resourcefork help


Quote:
> I have a resources in my project.There are 2 pict in it, id 128 and id
> 129.Can i change the content of this pict?
> I try addpicture myima,129,"" but don't work
> How can i do that?

I don't know why AddPicture wouldn't do it -- I *know* AddResource
will!  If all else fails, you might want to try to figure out how to
use AddResource to put the picture in the resource fork.

The reason I know this works is I recently wrote a mini-installer that
would take every resource from one file and stick it in another, and it
overwrote old resources without a problem.



Sun, 28 Sep 2003 22:31:21 GMT  
 Resourcefork help

Quote:
> I don't think you can for some reason, I've just tried to do it myself but
> with no results. Why are you trying to put a different picture into your
> apps resource fork? If its for preferences, put a prefs file in the
> preferences folder and add the picture to its resourcefork.

I'm a newbie. Can you help me with how to make such a preferences file as a
resourcefork? At present im using text files but thats clumsy and very insafe
for storing serials etc. Is there something similar as resourcefiles thats
Win32 compatible? (for preferences use).

BR

Mark



Mon, 29 Sep 2003 00:13:46 GMT  
 Resourcefork help
Heya Mark;

If you're storing preferences in the resource fork thats cool and easy
enough to do.  Bear in mind though anyone with a resource editor can open
it, which means its still not a good place to store serial #'s etc, at least
not without scrambling them.  Anyhow.  To make it work, just call
AddResource (look under the online help in RB for documentation) to a
resourceFork instance (of a valid folderItem).  You can store whatever you
want in it this way.

Play with it a bit and you'll see its super easy.  As for windows, remember
that files do not contain a 'resource fork'.  I've never tried doing this
through RB, but ini files or the registry are where you should store such
information as preference settings, registration info etc.  Under VB its not
a problem.  Sorry I can't help much under RB for Win32.

Cheers;
Seth



Quote:
> > I don't think you can for some reason, I've just tried to do it myself
but
> > with no results. Why are you trying to put a different picture into your
> > apps resource fork? If its for preferences, put a prefs file in the
> > preferences folder and add the picture to its resourcefork.

> I'm a newbie. Can you help me with how to make such a preferences file as
a
> resourcefork? At present im using text files but thats clumsy and very
insafe
> for storing serials etc. Is there something similar as resourcefiles thats
> Win32 compatible? (for preferences use).

> BR

> Mark



Mon, 29 Sep 2003 00:34:32 GMT  
 Resourcefork help
Heya Mark;

If you're storing preferences in the resource fork thats cool and easy
enough to do.  Bear in mind though anyone with a resource editor can open
it, which means its still not a good place to store serial #'s etc, at least
not without scrambling them.  Anyhow.  To make it work, just call
AddResource (look under the online help in RB for documentation) to a
resourceFork instance (of a valid folderItem).  You can store whatever you
want in it this way.

Play with it a bit and you'll see its super easy.  As for windows, remember
that files do not contain a 'resource fork'.  I've never tried doing this
through RB, but ini files or the registry are where you should store such
information as preference settings, registration info etc.  Under VB its not
a problem.  Sorry I can't help much under RB for Win32.

Cheers;
Seth



Quote:
> > I don't think you can for some reason, I've just tried to do it myself
but
> > with no results. Why are you trying to put a different picture into your
> > apps resource fork? If its for preferences, put a prefs file in the
> > preferences folder and add the picture to its resourcefork.

> I'm a newbie. Can you help me with how to make such a preferences file as
a
> resourcefork? At present im using text files but thats clumsy and very
insafe
> for storing serials etc. Is there something similar as resourcefiles thats
> Win32 compatible? (for preferences use).

> BR

> Mark



Mon, 29 Sep 2003 01:49:33 GMT  
 Resourcefork help


Quote:


>> I have a resources in my project.There are 2 pict in it, id 128 and id
>> 129.Can i change the content of this pict?
>> I try addpicture myima,129,"" but don't work
>> How can i do that?

> I don't know why AddPicture wouldn't do it -- I *know* AddResource
> will!  If all else fails, you might want to try to figure out how to
> use AddResource to put the picture in the resource fork.

> The reason I know this works is I recently wrote a mini-installer that
> would take every resource from one file and stick it in another, and it
> overwrote old resources without a problem.

Thats because you didn't have the file you were writing to at the time open.
You can't write or delete a file which is in use.

Hope this helps :-)

-------------------------
Chris Willis

-------------------------



Mon, 29 Sep 2003 04:36:19 GMT  
 Resourcefork help

11/4/01 5:13 pm:

Quote:
>> I don't think you can for some reason, I've just tried to do it myself but
>> with no results. Why are you trying to put a different picture into your
>> apps resource fork? If its for preferences, put a prefs file in the
>> preferences folder and add the picture to its resourcefork.

> I'm a newbie. Can you help me with how to make such a preferences file as a
> resourcefork? At present im using text files but thats clumsy and very insafe
> for storing serials etc. Is there something similar as resourcefiles thats
> Win32 compatible? (for preferences use).

> BR

> Mark

Hi,

If your storing serial numbers in the prefs file, make sure you encrypt it
first so no one can obtain it. The are no resource forks in windows, so
you'll have to write it to a text file like you were. To change the file
type of the prefs file from text to something else, make sure you have the
text file type in the file types dialog (name="text") but you can change the
creator and type as you wish.

Hope this helps :-)

-------------------------
Chris Willis

-------------------------



Mon, 29 Sep 2003 06:31:33 GMT  
 Resourcefork help

Quote:
> If your storing serial numbers in the prefs file, make sure you encrypt it
> first so no one can obtain it. The are no resource forks in windows, so
> you'll have to write it to a text file like you were. To change the file
> type of the prefs file from text to something else, make sure you have the
> text file type in the file types dialog (name="text") but you can change the
> creator and type as you wish.

How do i encrypt it?

mark



Mon, 29 Sep 2003 08:25:29 GMT  
 Resourcefork help
There are some really good string encryption classes I've seen before that
would work perfectly for you.  I don't remember the name of any in
particular, but if I recall the best one I saw was part of a preferences
module.  You might want to check the webring or run a google search for
REALbasic preferences (or something similar) and find a preferences module
that has one of these encryption methods.

Seth



Quote:
> How do i encrypt it?

> mark



Mon, 29 Sep 2003 23:40:30 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Using App.ResourceFork HELP!

2. FolderItem.ResourceFork resfNum How ?

3. Writing to the resourcefork

4. dragItems and resourceForks

5. ResourceFork

6. Resourceforks

7. How do create a File and add ResourceForks

8. Problems with ResourceFork Class

9. help! f90.help help help help

10. ***HELP***HELP***NEED INFORMATION***HELP***HELP

11. HELP HELP HELP HELP

12. HELP HELP HELP HELP

 

 
Powered by phpBB® Forum Software