码迷,mamicode.com
首页 > 其他好文 > 详细

SAFEARRAY

时间:2015-02-06 11:01:52      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

SAFEARRAY SafeArrayCreate  SafeArrayDestroy

    // Specify the bounds:
    // -- dim. count = 2
    // -- element count = 8 for each dimension
    // -- low bound = 0 for each dimension
    SAFEARRAYBOUND mySafeArrayBounds[2] = { {8, 0}, {8, 0}};
 
    // Create mySafeArray
    SAFEARRAY *mySafeArray =
        SafeArrayCreate(VT_I2 /* var. type: 2 byte signed int */ ,
        2 /* dim. count */ , mySafeArrayBounds);
 
    // Set value 100 to element [3][7]
    int16_t *elementPtr = ((int16_t*)mySafeArray->pvData) +
        3 * mySafeArray->rgsabound[0].cElements + 7;
    *elementPtr = 100;
 
    // Destroy mySafeArray
    SafeArrayDestroy(mySafeArray);

 

SAFEARRAY

标签:

原文地址:http://www.cnblogs.com/cb168/p/4276381.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!