--- Mike Montalvo wrote:
> The following code compiled fine using the 3.1 SDK.
> 
> Handle hErrorStringsRsrc;
> ...
> hErrorStringsRsrc = (char**)DmGetResource('tSTL',
> ErrorCodesStringList); // get the resource
> ...
> What the heck is an _opaque*?

Basically, it means "you're not supposed to look at
it".  It's not transparent.  No peeking!

Your previous code was relying on the fact that a
Handle was just a pointer to a pointer.  You cast the
Handle returned by DmGetResource with (char **), but
then assign it to a Handle.  Kind of sloppy looking. 
Normally, you would do something like:

  Char ** cPP;
  cPP = (Char **)SomethingYouCanCastToCharStarStar();

But, you shouldn't be casting MemHandles to anything
because they are "opaque".  Most often, what you do
with a MemHandle is lock it to get a pointer and cast
that pointer to a type that you can use.

> ...
> I get "Illegal type" error on the last line 
> (the StrLen).  It highlights the last "]".

Right.  Your code isn't going to work now, even though
it might have worked before.

Why not just use SysStringByIndex()?  For example:

  UInt16 len;
  Char strP(kMAXLEN);
  // get the length of the string at a particular
index
  SysStringByIndex( ErrorCodesStringList, x, strP,
kMAXLEN );
  len = StrLen(strP);

SysStringByIndex() has been there since the Palm OS
2.0 New Feature Set.


__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to