Ciao.
Mi sto rompendo la testa con com.
ho questo codice:
[code]
SAFEARRAY* m_pSAEmpty2 = SafeArrayCreate(VT_BSTR, 1, aDim);//create safearray 1 in BSTR
SAFEARRAY* m_pSAEmptyDec = SafeArrayCreate(VT_R8, 1, aDim);//create safearray 2 in decimal

//e cosi' via
//.
//.
when i load data from the api:
HRESULT hr= m_pSapModel->Results->MultiFrameForce(bstrAll,P2000::GroupElm,&n,&m_pSA FrameObj,&m_pSAEmptyDec ,&m_pSAElm,&m_pSAElmStation,&m_pSACase,&m_pSAEmpty 1,&m_pSAEmptyDec1,&m_pSA_P,&m_pSA_V2,&m_pSA_V3,&m_ pSA_T,&m_pSA_M2,&m_pSA_M3);

}

[code]


questa è la specifica per il vb , ma io uso c++:

Function MultiFrameForce(ByVal Name As String, ByVal ItemTypeElm As eItemTypeElm, ByRef NumberResults As Long, ByRef Obj() As String, ByRef ObjSta() As Double, ByRef Elm() As String, ByRef ElmSta() As Double, ByRef ACase() As String, ByRef StepType() As String, ByRef StepNum() As Double, ByRef P() As Double, ByRef V2() As Double, ByRef V3() As Double, ByRef T() As Double, ByRef M2() As Double, ByRef M3() As Double) As Long

dove c'è un array di vb , ci va messo un safearray di c++ col tipo degli elementi dell array.
QUando uso per un double VT_R8 è giusto?
il problema è che quando i risultati sono pochi tutto funziona correttamente , ma quando sono tanti (dell'ordine di 200000 elementi(stringhe o double) per safearray)la funzione dell'api mi ritorna S_FALSE in hr e non importa i dati
S_FALSE come ritorno significa che c'è qualche errore , come dicono le specifiche ,ma non so quale errore,perchè non è specificato.

puo' essere un problema di memoria?
prima di chiamare l'api il programma fa altre letture , sempre di quell'ordine di grandezza , ho usato SafeArrayDestroy(nomesafearray);
c'è da fare qualcosaltro per liberare le risorse?