I have used the code below successfully to query addressbook for an
address selection dialog, but on OS/3.5 especially it just doesn't work.
The errors are never triggered (err is 0 in all cases), but it just
doesn't launch AddressBook at all. Can anyone spot what's going on?
VoidHand CallAddressApp(CharPtr title, CharPtr keyP)
{
Err err = 0;
AddrLookupParamsType params;
UInt cardNo;
DWord result;
LocalID dbID;
DmSearchStateType searchState;
char LookupButton[] = "Pick";
char LookupFormat[] = "^email";
params.title = title;
params.pasteButtonText = LookupButton;
params.formatStringP = LookupFormat;
params.field1 = addrLookupSortField;
params.field2 = addrLookupEmail;
params.field2Optional = false;
if (keyP) {
MemSet(params.lookupString, addrLookupStringLength, 0);
StrNCopy(params.lookupString, keyP, addrLookupStringLength- 1);
} else *params.lookupString = 0;
// Get the card number and database id of the Address application.
err = DmGetNextDatabaseByTypeCreator (true, &searchState,
sysFileTApplication, sysFileCAddress, true, &cardNo,&dbID);
ErrFatalDisplayIf(err, "Address Book not found!");
if (!err) {
err = SysAppLaunch (cardNo, dbID, 0, sysAppLaunchCmdLookup,
(Ptr)¶ms, &result);
ErrFatalDisplayIf(err, "Error sending lookup action to app");
}
if (err) return NULL;;
return (params.resultStringH);
}
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/