Jump to content

Recommended Posts

Posted

Hi,

i'm sorry for my english.... :whistle:

i have a program in vb 6 that use one function from c++ dll, it give it SafeArrays as parameteres....

all work good.

the pb come when i use an activex control with the same code as the program in vb, and this control is used in excel..... :blushing:

the function in c++ have several safearrays as parameters, one of them i can't get it (the c++ can't 'catch' the data) all the other are just arrays of double or of struct, but the pb one is an array of struct witch contain an array :}

Private Type GElement

data() As Double

S As Double

S3 As Double

End Type

Private arGroupes() As GElement

....

RetVal = myCppFunction(arGroupes(),...)

.....

double __declspec(dllexport) CALLBACK myCppFunction(LPSAFEARRAY FAR *saData,....)

...

GElement HUGEP * arGroupes;

...

{

....

SafeArrayAccessData(*saData, (void HUGEP**)&arGroupes); //arGroupe will not contain what it have to :no:

....

}


Posted (edited)

i am stupid :blushing: it's not a pb with safearray

the order was different

Private Type GElement

data() As Double

S As Double

S3 As Double

End Type

Private Type GElement

S As Double

S3 As Double

data() As Double

End Type

Edited by simply_red

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...