parkise, I can't make it...
For instance, I've a DLL that will return a pointer that point to an array as below:
PHP Code:
//Code in DLL
extern "C" __declspec(dllexport) *long TestFunction2(long * lpSz)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
long *MyArray[n];
// Others code here to fill up the dynamic array with size n
return MyArray;
}
PHP Code:
//Code in Normal App
void CTestMyDLLDlg::OnButton1()
{
// TODO: Add your control notification handler code here
long *MyAry;
long *Sz=NULL;
MyAry = TestFunction(*Sz);
//Question is here, I always get the 0 in *Sz, 'coz the DLL release the memory for the value that assign to lpSz in the DLL itself.
}
My problem is, this function only return the pointer point to the array and I can not get the array size.
So, how can i get the array size? (No MFC :rolleyes:)
how can I write some code that the DLL can accept a pass in variable (Example long pointer) and then the DLL will fill up this pointer with the array size (like those Windows API that we call in VB all the day).
Thanks for advance
:)