The most likely reason that no one has responded is that no one
knows how to resolve your problem. What more have you learned
since you posted before? What else have you tried? You've simply
posted the same information without even telling us more about
things like what version of the code you have, what installed
version, if you've made other modification, what Mac OS version,
what flags you set in your project file, what additional
experiments you've tried, etc. Just reposting the same
information with some exclamation marks after a few days of
(apparently) sitting on your hands is not going to make people
more inclied to help you figure out your problem (except foolish
me apparently).
From my point of view, I doubt that you are really using the
exact same test JS code and component to generate the two outputs
you show. I know of no reasonable way that you would see the
first output given the code you say you are using. I suspect that
you have one version of the file with the QueryInterface line
commented out and do not realise it. The QueryInterface line
would either succeed (and print something other than what you
show) or fail and either give a JS error or throw an exception -
either way it would not reach the alert line and show the alert
you say it shows.
So, I'm saying that I think the most likely thing is that you
have setup your test differently than you think. Or perhaps there
is something wrong with your project setting in such a way that
the component you are building ends up getting called in some
hard to imagine wrong way. But, I really doubt that.
I quickly built nsSample.cpp on windows and it produced the
expected result using your sample JS code on my builds of mozilla
using the browser, viewer, xpcshell, and also on NS6.
John.
Sidnei Frank wrote:
> People, it's very serious, I really don't know what is going on with my
> components!!!!
>
> Hi All,
> I modified the code of sample for debug purposes:
>
> /* to use nsSample.js version, use "@mozilla.org/jssample;1" */
> netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
> var sample = Components.classes["@mozilla.org/sample;1"].createInstance();
> sample = sample.QueryInterface(Components.interfaces.nsISample);
> alert(sample); /*my debug*/
>
> I followed the instructions on readme.txt:
> "Because this sample is not part of the build system, you
> have to do some things by hand. Build it like this:
>
> 1. Have a built tree.
>
> 2. Build SampleIDL.mcp, headers target. This should make an alias
> to nsISample.h in dist:xpconnect (actual location in dist
> does not matter).
>
> 3. Build SampleIDL.mcp, sample.xpt target. This makes sample.xpt.
> Put an alias to sample.xpt in your Components folder.
>
> 4. Build a target of Sample.mcp. Make an alias to the resulting
> shared lib in the components folder.
>
> 5. Run viewer or apprunner, and load "xpconnect-sample.html".
> Things should work.
>
> [EMAIL PROTECTED]
> "
>
> I tryed to execute the sample on Mozilla built tree and on Mozilla
> folder (mozilla installed), and I have the following results
> (to test this on Mozilla browser, I made a copy of the shared lib and
> xpt files on Mozillas's Components folder)
> ======================================================
> on mozilla built tree (running the viewer.app):
>
> alert shows => [xpconnect wrapped nsISupports]
>
> ======================================================
> on mozilla installed (running the mozilla browser):
>
> alert shows => [xpconnect wrapped nsISample]
> ======================================================
>
>
> Would you help me with this issue?
>
> Thanks
>
>
> Sidnei Frank
> [EMAIL PROTECTED]
>