인터페이스 설명 언어에서 int [] 속성을 어떻게 표현합니까?
문제
IDL 에서이 속성을 어떻게 구현하겠습니까?
public int[] Params
{
get
{
return _Params;
}
set
{
_Params = value;
}
}
아래의 IDL 코드를 시도했습니다
[propget, helpstring("The click through parameters")]
HRESULT Params([out, retval] int *rVal);
[propput, helpstring("The click through parameters")]
HRESULT Params([in] int *RnewVal);
그러나 내 컴파일러가 이것을 찾고 있습니다
public int get_Params()
{
throw new NotImplementedException();
}
public void set_Params(ref int rVal)
{
throw new NotImplementedException();
}
99.999%가 유형에 문제가 있다고 확신합니다.
해결책
com typelib 수입 업체는 자동화 호환 인터페이스를 처리하는 것을 선호하므로 사용하십시오. 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);
제휴하지 않습니다 StackOverflow