When you need to create or access well-known objects in XPCOM, where do you find their contract IDs?
A:
It really depends on the object you are looking for. Generally, the documentation will tell you what the contract ID is. If there's a specific contract ID you are looking for, that'd be an easier to answer question.
sdwilsh
2009-11-29 18:53:12
Replace "generally" with "sometimes". However, I found all contract IDs I needed using Google. The documentation often does only describe the interface but does not contain the contract ID. Sometimes there isn't even a description of the interface on https://developer.mozilla.org/ even though the interface in question has appropriate comments on http://mxr.mozilla.org/. Sometimes even the documentation there is incomplete and you have to look at a certain implementation of the interface.
panzi
2010-08-03 01:38:14
PS: How I use Google for this purpose: I just google for:`getService(Components.interfaces.nsIInterfaceInQuestion)`or`createInstance(Components.interfaces.nsIInterfaceInQuestion)`
panzi
2010-08-03 01:41:30
Note that it is a wiki and can be improved by you too.
sdwilsh
2010-08-03 04:17:19
+1
A:
You also should look at the Mozilla code through http://mxr.mozilla.org to understand how people use interfaces and functions your want to use.
Paul Rouget
2010-01-23 21:46:43