The XPCOM API can allow you to create low level extensions — I mean written in C++, with support for C and assembler through C++ — and plug ins for Mozilla products. For example, you can create an extension to browse IMAP folders from Mozilla Firefox. This API is analogous to the COM+ API on Micro$oft Windows. One of my most recent projects, is a Firefox extension to handle SNMP protocol requests from JavaScript, so my extension is applied from the JavaScript within the HTML in the browser, allowing Firefox to act as an SNMP client. The extension is working fine, without memory leaks and allows you to do get and walk request. Possibly it will be expanded to more requests on the future.
web developer & system programmer
coder . cl
ramblings and thoughts on programming...
mozilla extensions with xpcom
published: 31-07-2010 / updated: 31-07-2010posted in: c, c++, programming, projects, tips
by Daniel Molina Wegener
c++ type casting operators
published: 25-07-2010 / updated: 25-07-2010posted in: c++, programming, tips
by Daniel Molina Wegener
Traditionally, C programmers and Java programmers are accustomed to use the type casting form: (type)variable. C++, instead of that classical type casting form, has various type casting operators, used for different purposes. Each operator is used with different kinds of references, for example, you can not use the static_cast operator with virtual classes. Type casting operators in C++ has a syntax very similar to C++ Templates: cast_operator<type>(variable).
c++0x, deprecation of exported templates
published: 24-10-2009 / updated: 24-10-2009posted in: c++, programming, tips
by Daniel Molina Wegener
C++0x, the incoming C++ standard, is subject of continuous changes. Few months ago C++0x Concepts were removed from the working draft. Now, Template Exports will be deprecated from the future standard. What does it means?. "A template defines a family of classes, functions, or concept maps, or an alias for a family of types". Who has worked with C++ templates, knows that they are the most powerful approach to abstraction. Also they are pretty similar to the Java Generics, but different enough to hold more complex classes and methods, such as working with operators.
some C++0x functional programming features
published: 02-09-2009 / updated: 02-09-2009posted in: c++, programming, tips
by Daniel Molina Wegener
I know a little about functional programming. Certainly, It have interesting features, such as Lambda Expressions and Closures. It seems that C++0x, the new C++ standard will support both of them. Closures, known as nested functions and Lambda Expressions, known as anonymous functions are neat tools on developing fast code with small pieces of them. Lambda expressions can be used as arguments. They allow certain kind of abstractions, allowing the implementation of computational structures like Monads and Monoids.
interpreting valgrind messages
published: 15-08-2009 / updated: 15-08-2009posted in: c, c++, programming, tips
by Daniel Molina Wegener
In other posts I’ve presented you some ways to detect memory leaks, conceptually rather than practically, but enough to understand them and solve those programming issues. Normally, valgrind messages. There are some posts about valgrind and well documented user guides, such as the guide written by Alex Ott. This article is about on how to interpret valgrind messages while you are using it as memory allocation debugger.

