Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 15, 2018 10:04 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: AddressBook Crash
PostPosted: Mon Dec 03, 2012 3:05 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
I have this code to try and get the users name/email address
#If TargetMacOS

Dim AddrBoOK As AddressBoOK
Try
AddrBoOK=System.AddressBoOK
Registered_EMAIL=AddrBoOK.CurrentUser.EmailAddresses.Text
Registered_NAME=Trim(Trim(AddrBoOK.CurrentUser.FirstName+" "+AddrBoOK.CurrentUser.MiddleName)+" "+AddrBoOK.CurrentUser.LastName)
Catch
Declare Function CSCopyUserName Lib "Carbon" (useShortName As Boolean) As CFStringRef
Registered_NAME=CSCopyUserName(False)
End Try

#ElseIf TargetWin32
Dim custregitem As RegistryItem
Try
custRegItem = New RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion")
Registered_NAME=custregitem.value("RegisteredOwner").StringValue
Catch
End Try
#EndIf


Works perfectly for me, under LION and MT.LION both.... but a user in Germany (and member of this forum) has my app crash with it hits this code..... as in crashes HARD....


Anyone have any ideas???

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: AddressBook Crash
PostPosted: Mon Dec 03, 2012 3:32 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
Code works for me on a Mac, even the code in the declare. Are these Mac or Windows users? Can you get a crash log?

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: AddressBook Crash
PostPosted: Mon Dec 03, 2012 3:37 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
I figured it out....

if there is not a "ME" card in the AddressBook for the current user then

AddrBoOK.CurrentUser is NIL

and BOOM

am adding code to detect that and skip this section


Thanks

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: AddressBook Crash
PostPosted: Mon Dec 03, 2012 3:40 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
Oh yeah, I was just about to say that... :wink:

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group