2009-07-30 2 views
0

Comment voulez-vous mettre en œuvre cette propriété en IDL:Comment exprimez-vous une propriété int [] dans le langage de description d'interface?

public int[] Params 
    { 
     get 
     { 
      return _Params; 
     } 
     set 
     { 
      _Params = value; 
     } 
    } 

J'ai essayé le code IDL ci-dessous

[propget, helpstring("The click through parameters")] 
    HRESULT Params([out, retval] int *rVal); 
[propput, helpstring("The click through parameters")] 
    HRESULT Params([in] int *RnewVal); 

Mais mon compilateur cherche ce

public int get_Params() 
{ 
    throw new NotImplementedException(); 
} 

public void set_Params(ref int rVal) 
{ 
    throw new NotImplementedException(); 
} 

Je suis 99,999% Assurez-vous que c'est un problème avec les types.

+0

Vous avez mal orthographié Params dans le code d'origine. –

+0

touche j'ai fait. Fixé. Cette erreur n'était pas dans le code, cependant – Dlongnecker

Répondre

3

importateur COM typelib préfère traiter avec des interfaces d'automatisation compatibles, utilisez donc 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); 
+0

Ça l'a fait! Merci – Dlongnecker

Questions connexes