Anis wrote:
Hi Suresh,
I am working with the Mozilla Browser code for during last week on Linux. I
have a query, it would be great if you provide few pointers to the solution
so that i can proceed.

Objective:
My objective is to write a simple C++ program which can access the standard
XPCOM objects provided by the browser like Cookie Manager, Password Manager
etc. I have looked at the source code and found a sample XPCOM component + a
sample C++ program nsTestSample. cpp(in mozilla/xpcom/sample/) I have build
it and it works fine.

Problem:
To begin with i have modified the nsTestSample.cpp itself to access
@mozila.org/cookiemanager;1.  The Instance creation and registration is
fine. But when i add the method  ->removeAll() i get a compilation error
"removeAll undeclared." I manually copied the idl files, header files and
libcookie.so into  the current directory (mozilla/xpcom/sample)...and am
using the same Makefile used for the xpcom/sample. I am not able to figure
our what the problem is....

In C++ we use a StudlyCaps naming convention, so the method is named RemoveAll (even though it's called removeAll in the IDL, and in javascript).


The applications in our build system get shipped to dist/bin and components get shipped to dist/bin/components. This is where you should be running your sample.

The problem with putting your application in xpcom/sample is that directory gets built before extensions/cookie. If you put your component into the end of the build process (for example, in extensions/mycomponent and then --enable-extensions=default,mycomponent), you can add REQUIRES = cookie to your makefile, and you won't need to copy any headers/IDL/libraries at all.

--BDS
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to