Results 1 to 2 of 2

Thread: parkise, I can't make it...

  1. #1

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    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 )

    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

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width