• <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 閱讀(348) 評論(0)  編輯 收藏 引用 所屬分類: C++
            国内精品伊人久久久久777| 韩国免费A级毛片久久| 青青草国产精品久久| 国产精品热久久无码av| 久久国产视屏| 久久成人小视频| 国产精品久久精品| 精品综合久久久久久98| 精品久久久久久久中文字幕| 日韩精品久久无码中文字幕| 久久久久久极精品久久久| 午夜精品久久久久久| 久久精品不卡| 久久人人爽人人爽人人片AV不| av国内精品久久久久影院| 色婷婷狠狠久久综合五月| 国产亚洲综合久久系列| 久久久久se色偷偷亚洲精品av| 97久久超碰国产精品旧版| 国产精品久久久久久久久软件| 91精品日韩人妻无码久久不卡| 久久国产一区二区| 亚洲国产精品久久| 久久综合88熟人妻| 亚洲国产成人久久综合区| 亚洲国产成人乱码精品女人久久久不卡| 亚洲精品乱码久久久久久蜜桃不卡 | 伊人久久国产免费观看视频| 久久精品国产精品青草| 狠狠色狠狠色综合久久| 一级a性色生活片久久无| 久久亚洲国产精品123区| 久久毛片一区二区| 性欧美大战久久久久久久| 色综合久久中文色婷婷| 色成年激情久久综合| 国产精品久久免费| 久久精品国产清高在天天线| 国产精品99久久久久久猫咪| 日本三级久久网| 精品99久久aaa一级毛片|