Thread View: pilot.programmer.codewarrior
2 messages
2 total messages
Started by John Shehata
Tue, 31 Jul 2001 21:47
getting the number of items in a resource
Author: John Shehata
Date: Tue, 31 Jul 2001 21:47
Date: Tue, 31 Jul 2001 21:47
22 lines
1622 bytes
1622 bytes
Hi,
I am trying to get the number of items in a Str Resource that i have, but
have not been able to pull it off. Below is what i am using. I want to get
the number of items in DueDtAppInfoStr.
// loading the data into my list
stringH = DmGetResource('tAIS', DueDtAppInfoStr);
duedt = (char *) MemHandleLock(stringH);
// here is how i am trying to do this...
numChoices = sizeof(stringH)
acnoholds = SysFormPointerArrayToString(duedt, numChoices);
Any Help would be greatly appreciated.
--
-John
AOL IM: tut00
ground-0-zero software engineering
http://www.ground-0-zero.com
Re: getting the number of items in a resource
Author: George Caswell
Date: Tue, 31 Jul 2001 23:13
Date: Tue, 31 Jul 2001 23:13
25 lines
2568 bytes
2568 bytes
On Tue, 31 Jul 2001, John Shehata wrote: > Hi, > > I am trying to get the number of items in a Str Resource that i have, but > have not been able to pull it off. Below is what i am using. I want to get > the number of items in DueDtAppInfoStr. > One. String resources contain one string. If you want more, use a string list resource. Of course, technically, you can store whatever you want in a string resource. If you do choose to pack multiple null-terminated strings in a single string resource, you can figure out how many are there by getting the size of the resource and counting the strings. Use MemHandleSize() to get the size of the resource, and then iterate through the locked resource (not going past the end) counting the null characters you find. Just keep in mind that this is non-standard. Use a string list resource - then you'll have a string count, and you'll be able to edit the list with other resource editors. ---GEC Projects page: http://home.maine.rr.com/tetsujin/ (M-x depeche-mode) "I am but the humble student, who hopes one day to snatch the resin-cast pebble from the master's fully articulated hand."
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads