The line...
rv = (PRInt32 *)3;
... is wrong.
You mean...
*rv = 3;
John.
eeniac wrote:
>
> Hi all,
> I'm trying to call a simple test XPCOM function(C++)
> from Javascript and I can't get a return value besides
> 0.The function looks like this:
>
> NS_IMETHODIMP
> TestImpl::Test(const char * str1,
> const char * str2, PRInt32 * rv)
> {
> rv = (PRInt32 *)3;
> printf("rv=%d\n",rv);
> printf("str1=%s, srtr2=%s\n" str1,str2);
> return NS_OK;
> }
>
> I know that the function is being called as the
> printfs are printing correctly - i check the return in
> JavaScript as follows:
>
> var retVal = parseInt
> (xpcomInterface.Test("myString1","myString2"));
> dump("xpcomInterface.Test() returned "+retval+"\n");
>
> Any help would be greatly appreciated.
> e
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/