CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2000
    Location
    MONTEVIDEO,URUGUAY
    Posts
    30

    SAFEARRAY problem

    this code works fine if i create a 2 or 3 dimensional array.
    but if i try to make a safearray with 9 dimension m_parray goes to NULL.

    I dont know if i'm doing something wrong or simply Safearrays
    doesn't support more than 3 dimensions.
    Can someone help me?

    Thanks in advance

    SAFEARRAYBOUND *arrayBounds;
    long nDims = 9;

    arrayBounds = new SAFEARRAYBOUND [nDims];

    for ( i = 0; i < nDims; i++ ) {
    arrayBounds[i].lLbound = 0;
    arrayBounds[i].cElements = 15
    }

    SAFEARRAY *m_parray = SafeArrayCreate(VT_VARIANT, nDims, arrayBounds); // m_parray is NULL after the call

  2. #2
    Join Date
    Nov 2003
    Posts
    13
    Only thing I can think of is that there is no enough memory to create the 9-D array.

    csheng

  3. #3
    Join Date
    Mar 2002
    Location
    Izhevsk, Udmurtia, Russia
    Posts
    930
    It's because of 15*15*...*15 (9 times) of byte array is already great than 38GB memory. But you have the VARAINT array for which it's required more than 600GB. Be easier.
    With best wishes,
    Vita
    -----------------------
    Russian Software Development Network -- http://www.rsdn.ru

  4. #4
    Join Date
    Jul 2003
    Location
    Korea
    Posts
    60
    I don't know exactly what you want, this code will run:

    SAFEARRAYBOUND *arrayBounds;
    ong nDims = 19;

    arrayBounds = new SAFEARRAYBOUND [1];

    arrayBounds[0].lLbound = 0;
    arrayBounds[0].cElements = 15;

    SAFEARRAY *m_parray = SafeArrayCreate(VT_VARIANT, nDims, arrayBounds);
    Quang

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

Featured