XPCOM Cheat Sheet, first update

XPCOM “Cheat Sheet”

I defined a few more features here, mostly about passing arguments and return values in and out of components. Also a couple new sections on checking and setting null, and some highlighting (italics) to more clearly express which variables I’m talking about.

Pretty soon, I’ll have to ask for someone to write the Python sections of this cheat sheet.

5 thoughts on “XPCOM Cheat Sheet, first update”

  1. FWIW, /* */ Are not C++ style comments. // are.
    Plus, since every file type supports the same comment styles, why not simply put one set of examples ?
    (From Alex You are correct, and I have fixed that. Thanks!
    As for every file type supporting the same… that’s true for the files I mention in the cheat sheet now. However, that may not be true for languages such as Python or Perl, which I believe have XPCOM bindings in progress.)

  2. Single line comments (the // style) were added in C++, so you could call _that_ a C++ style comment 😉
    Also, you ought to use heading tags for your section headings so that it’s easier to see when you’ve gone from one to the next.
    (From Alex: The current version isn’t XHTML. So I need to think about that.)

  3. hmm, nice cheat sheet. im looking for a hint on how to return an instance of an interface in another interface function.
    ie, the result of do_CreateInstance() needs to somehoe be jammed into:
    nsIMyComponent ** newInstance
    (From Alex: I think you should ask your question in the mozilla.dev.tech.xpcom newsgroup, and with some larger samples of what you’re trying to do. 🙂 )

Comments are closed.