New topic: 

AddressBook Crash

<http://forums.realsoftware.com/viewtopic.php?t=46126>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        DaveS          Post subject: AddressBook CrashPosted: Mon Dec 
03, 2012 3:05 pm                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4323
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
MacPro, OSX Lion 10.7.4 RB2012r1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                ktekinay          Post subject: 
Re: AddressBook CrashPosted: Mon Dec 03, 2012 3:32 pm                           
      
Joined: Mon Feb 05, 2007 5:21 pm
Posts: 282
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                DaveS          Post subject: 
Re: AddressBook CrashPosted: Mon Dec 03, 2012 3:37 pm                           
      
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4323
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
MacPro, OSX Lion 10.7.4 RB2012r1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                ktekinay          Post subject: 
Re: AddressBook CrashPosted: Mon Dec 03, 2012 3:40 pm                           
      
Joined: Mon Feb 05, 2007 5:21 pm
Posts: 282
Location: New York, NY                Oh yeah, I was just about to say that...  
    
_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.
  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to