Re: AXUIElementCopyAttributeValue useage
Re: AXUIElementCopyAttributeValue useage
- Subject: Re: AXUIElementCopyAttributeValue useage
- From: Matt Gough <email@hidden>
- Date: Thu, 8 Jan 2004 10:27:46 +0000
On 8 Jan 2004, at 01:52, Modesitt Software wrote:
Then I do this to get the title as a Pascal string:
CFStringRef theCFStr = ::CFCopyDescription(cfRef);
Str255 theStr;
bool value = ::CFStringGetPascalString( theCFStr, theStr, 256,
kCFStringEncodingMacRoman);
Bill,
I am guessing that you have not used CF types much up until now. I
would recommend getting acquainted with them before delving too deeply
into using them.
One miscomprehension you seem to have is the purpose of
CFCopyDescription. It is not meant as a means of accessing the objects
data, just as a debugging aid. The objects themselves have proper
methods for introspection (they would be pretty useless otherwise).
I am guessing that you ended up doing it the way that you did because
the descriptions of all the attributes in AXConstants.h don't give any
indication of the expected type of the attribute returned and
AXUIElementCopyAttributeValue passes back the generic CFTypeRef. Until
you understand that there are many object types which inherit from this
and which could be returned you will be confused.
If you haven't done so already, make you way over to:
http://developer.apple.com/documentation/CoreFoundation/
CoreFoundation.html
and start reading.
Hope this helps
Matt Gough
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.