I use nsFocusManager::GetManager() so as to get an instance of nsIFocusManager. However, i get an unknown symbol error for nsFocusManager when linking, can anyone help me?
cst wrote: >I use nsFocusManager::GetManager() so as to get an instance of nsIFocusManager. >However, i get an unknown symbol error for nsFocusManager when linking, can anyone help me?
nsFocusManager is only available internally. External code should use the "@mozilla.org/focus-manager;1" service.
Can you show me some example code? I failed to get the service...
Chi Song Tao @ Beijing
From: Neil Date: 2010-08-02 19:41:23 To: dev-extensions Cc: Subject: Re: Get a link error when getting nsIFocusManager in vc++
cst wrote: >I use nsFocusManager::GetManager() so as to get an instance of nsIFocusManager. >However, i get an unknown symbol error for nsFocusManager when linking, can anyone help me?
nsFocusManager is only available internally. External code should use the "@mozilla.org/focus-manager;1" service. -- Warning: May contain traces of nuts. _______________________________________________ dev-extensions mailing list dev-extensi...@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-extensions
cst wrote: >Can you show me some example code? >I failed to get the service...
I only know of example JS code, such as this portion of printUtils.js: 299 var fm = Components.classes["@mozilla.org/focus-manager;1"] 300 .getService(Components.interfaces.nsIFocusManager); 301 if (gFocusedElement) 302 fm.setFocus(gFocusedElement, fm.FLAG_NOSCROLL);
Thanks all the same. It is surprised that I get a null pointer when I getService in vc++.
BTW, why is there nearly nothing helpful in MDC about creating extensions in native code? Most of the docs about this are out of date and Lack of example also lead to difficulty.
From: Neil Date: 2010-08-02 22:36:25 To: dev-extensions Cc: Subject: Re: Get a link error when getting nsIFocusManager in vc++
cst wrote: >Can you show me some example code? >I failed to get the service...
I only know of example JS code, such as this portion of printUtils.js: 299 var fm = Components.classes["@mozilla.org/focus-manager;1"] 300 .getService(Components.interfaces.nsIFocusManager); 301 if (gFocusedElement) 302 fm.setFocus(gFocusedElement, fm.FLAG_NOSCROLL); -- Warning: May contain traces of nuts. _______________________________________________ dev-extensions mailing list dev-extensi...@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-extensions
cst wrote: >BTW, why is there nearly nothing helpful in MDC about creating extensions in native code?
Because native code extensions are much harder to support. In fact the current line is that you should use ctypes to access native code for functions that you can't implement in script.