¿Cómo se expresa una propiedad int [] en el lenguaje de descripción de la interfaz?
Pregunta
¿Cómo implementaría esta propiedad en IDL:
public int[] Params
{
get
{
return _Params;
}
set
{
_Params = value;
}
}
Probé el código idl a continuación
[propget, helpstring("The click through parameters")]
HRESULT Params([out, retval] int *rVal);
[propput, helpstring("The click through parameters")]
HRESULT Params([in] int *RnewVal);
Pero mi compilador está buscando esto
public int get_Params()
{
throw new NotImplementedException();
}
public void set_Params(ref int rVal)
{
throw new NotImplementedException();
}
Estoy seguro al 99.999% de que es un problema con los tipos.
Solución
COM typelib importador prefiere tratar con interfaces compatibles con la automatización, así que use SAFEARRAY
:
[propget, helpstring("The click through parameters")]
HRESULT Params([out, retval] SAFEARRAY(long) *rVal);
[propput, helpstring("The click through parameters")]
HRESULT Params([in] SAFEARRAY(long) RnewVal);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow