NS_IMETHODIMP MyClass::DoStuff(nsIHTMLAppletElement *content) {
nsresult rv;
nsCOMPtr<nsIGenericHTMLElement> generic = do_QueryInterface((nsISupports*)content, &rv);
if (NS_FAILED(rv)) return rv;
}
When I try to compile the class containing the above function, I get errors that I think mean that It can't find the class nsIHTMLAppletElement or nsIGenericHTMLElement.
To reference those two classes, I have tried including them in my *.idl file with:
interface nsIHTMLAppletElement;
interface nsIGenericHTMLElement;
It results in these errors:
../../dist/include/xpcom/nsISupportsUtils.h: In static member function ‘static
const nsIID& nsCOMTypeInfo<T>::GetIID() [with T = nsIGenericHTMLElement]’:
../../dist/include/xpcom/nsCOMPtr.h:653: instantiated from
‘nsCOMPtr<T>::nsCOMPtr(const nsQueryInterfaceWithError&) [with T =
nsIGenericHTMLElement]’
*/mozilla/extensions/*/*.cpp:46: instantiated from here
../../dist/include/xpcom/nsISupportsUtils.h:202: error: incomplete type
‘nsIGenericHTMLElement’ used in nested name specifier
My *.h file generated from *.idl file does not look promising with the
following entries:
class nsIHTMLAppletElement; /* forward declaration */
class nsIGenericHTMLElement; /* forward declaration */
They are forward declarations meaning at some point in time they have to be defined so we can access the functions in them. How can I do this?
I can't find the header file for nsIHTMLAppletElement but I did find the cpp
file but it is in the base tree ans do I don't think it is meant to be included.
I can find nsGenericHTMLElement.h but that also is in another tree. Including
(#include) it results in a mass of errors as the header files that support it
are not accessible.
How so I resolve these errors and so compile it?.
Thank you.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom