Say I have inteface like this:
interface IHello : nsISupports
{
void hello(in long p1);
};
xpidl.exe generates C++ header file with invalid (imho) member name for
IHello interface:
...
/* void hello (in long p1); */
NS_IMETHOD Hello(PRInt32 p1) = 0;
};
So, how do I force it to generate correct one: hello() not Hello()?
--
With best regard, Igor.
The xpidl compiler capitalizes method names when generating C++ headers to
support existing C++ convention in Mozilla. But, it's better to use
interCaps style in your idl, so that you follow JavaScript convention(as you
will be calling those methods from JavaScript).
- Rajendra Prasad Murakonda,
http://prodizy.livejournal.com/
> > /* void hello (in long p1); */
> > NS_IMETHOD Hello(PRInt32 p1) = 0;
> > So, how do I force it to generate correct one: hello() not Hello()?
> The xpidl compiler capitalizes method names when generating C++ headers to
> support existing C++ convention in Mozilla. But, it's better to use
> interCaps style in your idl, so that you follow JavaScript convention(as you
> will be calling those methods from JavaScript).
I'm using (planning to) xpcom in my own C++ appication and there is
already defined naming convention. Is there any way to disable this
"feature"?
--
With best regards, Igor.
I have an extension that needs to receive information from the underlying component, namely a string
On XPIDL , I defined a function like this
void ObtainUser(out string str_user_name);
And the xpidl compiler generates a member prototype like this
NS_IMETHODIMP CObserver::ObtainUser(char **str_user_name);
Now my question is how I call this function to get the string in javascript
I've tried to call the function with one arguments, but I get an exception like this :
Erro: uncaught exception: [Exception... "'Out' argument must be an object arg 0 [nsIFoxPanel.ObtainUser]" nsresult: "0x80570002 (NS_ERROR_XPC_NEED_OUT_OBJECT)" location: "JS frame :: chrome://extensao/content/foxpanel.js :: <TOP_LEVEL> :: line 34" data: no]
I've tried to call it with no arguments, but I get an exception as well
Any help deeply appreciated
Cheers,
Oliveiros
If you instead defined it as:
string Obtainuser();
Then it'd be a function with no arguments in JS that just returns the
string.
> I've tried to call the function with one arguments, but I get an exception like this :
>
> Erro: uncaught exception: [Exception... "'Out' argument must be an object arg 0 [nsIFoxPanel.ObtainUser]" nsresult: "0x80570002 (NS_ERROR_XPC_NEED_OUT_OBJECT)" location: "JS frame :: chrome://extensao/content/foxpanel.js :: <TOP_LEVEL> :: line 34" data: no]
I don't know what your argument was but out params works like this:
var outval = {};
panel.ObtainUser(outval);
// Now use outval.value
But I'd suggest you use the IDL syntax I suggested above and do:
var yourstring = panel.ObtainUser();
--
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts, [...] --W. Shakespeare
I've already fixed it using the [retval] attribute and I was able to retrieve the string from my xpcom component
But another problem surfaces.
I can explain what I need.
I need to affect the value of a <label> overlay element on my extension with a string obtained from component.
I've tried to do it with this in js
label = document.getElementById("user_name_label");
label.value = data;
But the problem is when should I call this statements. they work but only when the browser is already displayed.
If I use these instructions before nothing changes on label.
Is there any event I can trap to place this instructions on?
I guess label doesnt have events
Thanks in advance
Cheers,
Oliveiros
> _______________________________________________
> dev-tech-xpcom mailing list
> dev-tec...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-xpcom
Many thanks in advance
http://developer.mozilla.org/en/docs/Extension_FAQ#Why_doesn.27t_my_script_run_properly.3F
Nickolay
I'll take this chance to ask if there is an automatic way to install an
extension on Mozilla browser, because the '-install-global-extension' switch
doesn't exist in this "very old" browser.
Is there some file I can programmatically change? I really need a way to
install an extension on Mozilla automatically
Thanks in advance
Cheers,
Oliveiros
----- Original Message -----
From: "Nickolay Ponomarev" <asqu...@gmail.com>
To: "Oliveiros Cristina" <oliveiros...@marktest.pt>
Cc: "Christian Biesinger" <cbies...@web.de>;
<dev-tec...@lists.mozilla.org>
Sent: Monday, July 10, 2006 11:51 AM
Subject: Re: How to pass values in XPCOM back to JS
Anyways, possible ways to install an extension (most of those are
supported on 1.5 or later) are listed here:
http://developer.mozilla.org/en/docs/Extension_Packaging#Install_Extension_Files_Directly
Nickolay
No, there is not.
John.