Pergunta

suppose I had this function defined in IDL like this:

[propget, id(6), helpstring("property MyArray")]
HRESULT MyArray([out, retval] SAFEARRAY(myEnum)* pVal);

and I wanted to create an overload for that function defined in IDL like this:

[propget, id(7), helpstring("property MyArray")]
HRESULT MyArray([out, retval] SAFEARRAY(BSTR)* pVal);

but in the header file of the class that implements the function the original was declared like this:

STDMETHOD(get_InstalledScanningDetectors)(SAFEARRAY** pVal);

so the type of the items in the array is no longer part of the signature. since I'm trying to create an overloaded function based on exactly this difference in the function's signatures.. how do I proceed??

Foi útil?

Solução

SAFEARRAY is the distinct type (actually a structure embedding array related members), and its effective element type cannot be a part of the signature. You can have single method to return this or that array, or otherwise you can have two methods with different names which both return arrays.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top