akashchopra
asked on
Returning arrays from C++ DLL to VB.net
I've got a C++ DLL which has a function that returns an array:
double* Test()
{
double ReturnArray[10];
...
return ReturnArray;
}
I call this from VB.net as follows:
Declare Function C_Test Lib "Test.dll" Alias "Test" () As Double()
Dim C_Result(9) As Double
C_Result = C_Test()
but get a "Can not marshal return value" error.
What am I missing?
Thanks
Akash
double* Test()
{
double ReturnArray[10];
...
return ReturnArray;
}
I call this from VB.net as follows:
Declare Function C_Test Lib "Test.dll" Alias "Test" () As Double()
Dim C_Result(9) As Double
C_Result = C_Test()
but get a "Can not marshal return value" error.
What am I missing?
Thanks
Akash
ASKER
Thanks, but there is so much information in that article that I'm not sure where to start. Could you provide an example, or at least a reference to the appropriate method of the marshal class?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check for article Q306801 in the microsoft knowledge base to see how to accomplish this, or check for marshal class in MSDN.
Cheers,
skaykay!