Subj : Re: nsIAddressBook getCardCount nsISupportsPRUint32 data or value To : Cimballi From : Brendan Eich Date : Wed Jun 08 2005 09:51 am Cimballi wrote: > Hi, > > A question about the method getCardCount() in the interface nsIAddressBook. > It needs a PRUint32 param but if I create a nsISupportsPRUint32 variable > and pass it to the function, there is an error which says : can't set > the "value" attribute. > This is normal because the nsISupportsPRUint32 has only a "data" attribute. Please use a better newsgroup. For general XPCOM questions, n.p.m.xpcom would be better, but since this is a question specific (http://lxr.mozilla.org/mozilla/source/mailnews/addrbook/public/nsIAddrDatabase.idl#177) to a mailnews/addrbook public interface, I'll use n.p.m.mail.news. > > Is this normal ? What kind of object should I pass to the function ? Just pass an empty object, e.g. var hardCount = {}; adb.getHardCount(hardCount); alert(hardCount.value); > > Thanks, Cc'ing bienvenu too -- David, any reason this method was not written in IDL as PRUint32 getHardCount(); ? Then XPConnect would allow the JS to look more natural: var hardCount = adb.getHardCount(); /be .