wismerhill__
Messages postés88Date d'inscriptionmercredi 1 juin 2005StatutMembreDernière intervention26 juillet 2007
-
22 juin 2006 à 17:33
oistrakh
Messages postés5Date d'inscriptionlundi 4 décembre 2000StatutMembreDernière intervention 7 juillet 2008
-
7 juil. 2008 à 20:56
Bonjour je veux exporter un UDT VBA vers C++, j'y arrive, mais je ne sais pas comment acceder aux champs de mon UDT
ma struct cpp
struct DATA
{
long struct_x;
BSTR struct_y;
};
ma fonction d'import cpp
void
__stdcall ImportUDT(SAFEARRAY **tableau)
{
DATA *elt;
HRESULT ret;
unsigned
long i;
if ((ret = SafeArrayAccessData(*tableau,(
void **) &elt))==S_OK)
{
for (i = 0; i < (*tableau)->rgsabound->cElements; i++)
{
//code comme par exemple
elt[i].struct_x = 0 ;//ce qu'il y a dans le i eme element de *tableau au champs UDT_x (cf type vba en dessous)
elt[i].struct_y = "" ;//ce qu'il y a dans le tableau
}
SafeArrayUnaccessData(*tableau);
}
}
(*tableau) est un tableau d'element d'un type bien particulier implementé en VBA
Private Type MonUDT
UDT_x As Long
UDT_y As String
End Type
comment puis acceder aux champs UDT_x et UDT_y contenus dans (*tableau) ???