首页 > 其他 > 详细

SAFEARRAY

时间:2015-02-06 11:01:29      阅读:256      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!