Hi,
I am trying to retrieve the "ifdProductID" value from the Info.plist
file using "CFDictionaryGetValue" in XCode 2.1 (10.4.2 , gcc-4.0) .
The code snippet I am using is something like this:
-------
if (!(myBundle = CFBundleGetBundleWithIdentifier(CFSTR(BUNDLE_NAME) ))) {
return FALSE;
}
// Retrieve the bundle's info.plist
bundleInfoDict = CFBundleGetInfoDictionary(myBundle);
if (bundleInfoDict == NULL) {
return FALSE;
}
iFound = FALSE;
kr = IOMasterPort(bootstrap_port, &masterPort);
if (kr || !masterPort) {
return FALSE;
}
// Get a matching dictionary for the class name
USBMatch = IOServiceMatching(kIOUSBDeviceClassName);
if (!USBMatch)
{
mach_port_deallocate(mach_task_self(), masterPort);
return FALSE;
}
if ( CFDictionaryGetValueIfPresent( USBMatch, CFSTR("ifdProductID"),
(const void **)&valueRef ) && \
CFGetTypeID(valueRef) == CFNumberGetTypeID() && \
CFNumberGetValue( (CFNumberRef)valueRef, kCFNumberShortType,
&aLongValue) )
{
syslog(LOG_CRIT," issue in CFNumberGetValue \n");
}
-------
After breaking up the IF loop, i found that the
"CFDictionaryGetValueIfPresent" itself failed. Please guide me
where/what I have done wrong here.
Thx
Joe
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle