• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            3D FPS

            1234567890

              C++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
              57 Posts :: 2 Stories :: 57 Comments :: 0 Trackbacks

            常用鏈接

            留言簿(10)

            我參與的團隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            com安全數組類型

            創建 復制數據給它 例如這樣:

             1// set up safearray -  SAFEARRAY is defined OAIDL.H
             2 SAFEARRAY *psa;
             3
             4 // create a safe array to store the stream data
             5 psa = SafeArrayCreateVector( VT_UI1, 0, llen );
             6
             7 // pointers to byte arrays
             8 unsigned char *pData = NULL;
             9
            10 // get a pointer to the safe array. Locks the array.
            11 SafeArrayAccessData( psa, (void**)&pData );
            12 
            13 // copy the memory file into the safearray
            14 memcpy( pData, pMemData, llen );
            15
            16 // clean up buffer
            17 delete pMemData;
            18 
            19 // unlock access to safearray
            20 SafeArrayUnaccessData(psa);
            21
            22 // return a pointer to a SAFEARRAY allocated here
            23 return psa;
            24
            25



             接收 復制數據給別人 例如這樣: 

             1 long lLength;   // number of bytes
             2 char *pBuffer;   // buffer pointer
             3 
             4 // lock access to array data
             5 SafeArrayAccessData( psa, (void**)&pBuffer  );
             6
             7 // get number of elements in array. This is the number of bytes
             8 lLength = psa->rgsabound->cElements;
             9
            10 // attach the buffer to the memory file
            11 memfile.Attach((unsigned char*)pBuffer, lLength);
            12
            13 // start at beginning of buffer
            14 memfile.SeekToBegin();
            15
            16 // create an archive with the attached memory file
            17 CArchive ar(&memfile, CArchive::load | CArchive::bNoFlushOnDelete);
            18
            19 // document pointer is not used
            20 ar.m_pDocument = NULL;
            21
            22 // inflate the object and get the pointer
            23 rpObj = ar.ReadObject(0);
            24
            25 // close the archive
            26 ar.Close();
            27
            28 // Note: pBuffer is freed when the SAFEARRAY is destroyed
            29 // Detach the buffer and close the file
            30 pBuffer = (char*) memfile.Detach();
            31
            32
            33 // release the safearray buffer
            34 SafeArrayUnaccessData( psa );
            35





            posted on 2011-12-25 18:43 DK_jims 閱讀(354) 評論(0)  編輯 收藏 引用 所屬分類: C++
            精品久久久久久| 国产精品青草久久久久福利99| 亚洲乱亚洲乱淫久久| 亚洲国产成人久久综合一区77| 久久精品人妻中文系列| 国产精品久久久久国产A级| 国产巨作麻豆欧美亚洲综合久久| 99久久国产综合精品五月天喷水 | 国产三级久久久精品麻豆三级| 国产精品久久波多野结衣| 久久久久久久精品妇女99| 国产成人久久激情91| 亚洲а∨天堂久久精品| 99久久人妻无码精品系列蜜桃| 日日狠狠久久偷偷色综合96蜜桃| 久久久久亚洲精品天堂| 中文字幕日本人妻久久久免费| 亚洲欧美日韩精品久久亚洲区| 国产精品99久久免费观看| 波多野结衣AV无码久久一区| 久久成人精品| 国产精品一区二区久久精品无码| 亚洲综合伊人久久大杳蕉| 亚洲七七久久精品中文国产 | 国产色综合久久无码有码| 久久久久国产| 国产精品久久新婚兰兰| 久久99精品国产麻豆不卡| 久久精品国产一区二区三区日韩| 亚洲国产另类久久久精品 | 伊人久久大香线焦AV综合影院| 久久精品国产99久久丝袜| 久久亚洲国产精品一区二区| A级毛片无码久久精品免费| 999久久久无码国产精品| 久久久亚洲欧洲日产国码aⅴ | 久久精品一区二区三区不卡| 久久久久久毛片免费播放| 精品无码久久久久国产| www久久久天天com| 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲 |