bonjour,

j'essai de passer des arguments non managés à partir d'une dll (managé à la base).

j'ai cherché là: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconDefaultMarshalingForArrays.asp
Mais comme d'habitude, aucune information pour le C++...

voici ma classe (qui se trouve dans la dll de référence)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
public __gc class MaClasse
{
public:
    void Appel([MarshalAs(UnmanagedType::LPArray, SizeConst=10)] float[] ar, [MarshalAs(UnmanagedType::LPArray, SizeConst=10)] float [] ab);
};
en gros j'aimerai appeller cette fonction de cette manière à partir de mon assembly:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
Appel(float[10], float[10]);
Mais mon compilateur (Visual C++ 2005 Professionel) n'aime pas trop ma méthode plus haut :/

Erreurs:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
error C2146: syntax error : missing ')' before identifier 'ar'
error C2146: syntax error : missing ';' before identifier 'ar'
error C2501: 'MaClasse::ar' : missing storage-class or type specifiers
error C2062: type 'float' unexpected
error C2146: syntax error : missing ')' before identifier 'ar'
error C2146: syntax error : missing ';' before identifier 'ar'
error C2501: 'MaClasse::ar' : missing storage-class or type specifiers
error C2062: type 'float' unexpected
error C2146: syntax error : missing ')' before identifier 'ar'
error C2146: syntax error : missing ';' before identifier 'ar'
error C2501: 'MaClasse::ar' : missing storage-class or type specifiers
error C2062: type 'float' unexpected
error C2146: syntax error : missing ')' before identifier 'ar'
error C2146: syntax error : missing ';' before identifier 'ar'
error C2501: 'MaClasse::ar' : missing storage-class or type specifiers
error C2062: type 'float' unexpected
Je sas pertinement que c'est une erreur de syntaxe mais je ne vois pas trop quel serait la bonne syntaxe vu qu'il n'y a aucune information à ce sujet en C++ sur l'msdn

Merci d'avance