领测软件测试网
软件测试技术门户3hD!}`Ez6iv}*E"u'{/CwJpQLx*wx软件测试技术门户]$T#w zAEpIRowset->ReleaseRows( uRowsObtained, phRows, NULL, NULL, NULL );
%uha0l2AP6GTO2o(tpIAccessor->ReleaseAccessor( hAccessor, NULL );
软件测试技术门户a.u*r/b8T,^2k,g)`pIAccessor.Release( );
软件测试技术门户%oo/}-mk8k"e,UP9tpIRowset.Release( );
软件测试技术门户*p
|u_
O/[?w 软件测试技术门户K~-k3tcts1f4~读操作也完成了,是不是仍然很简单呢?下面我们再来看看最麻烦的二进制数据(text、ntext、image等)的读写。要实现BLOB数据的读写,我们需要一个辅助的类,定义如下:
h8MLV3Iv0sZ9?A!Vclass CSequentialStream : public ISequentialStream // BLOB 数据访问类
Q*Tf.H+] lx{
^!E&qsFr~cpublic:
Ze,?7^D:j CSequentialStream( );
Bd/B|g+@}S virtual ~CSequentialStream( );
On1i^VD'o&A oN virtual BOOL Seek( ULONG uPosition );
软件测试技术门户6OH?Ua4l virtual BOOL Clear( );
1{s})M_-[Ue virtual ULONG GetLength( ) { return m_uBufferUsed; };
软件测试技术门户NEC6]`M\#YF virtual operator void* const( ) { return m_pBuffer; };
4|uT#~%u^;s&g t STDMETHODIMP_( ULONG ) AddRef( ) { return ++ m_uRefCount; };
软件测试技术门户o1N8a"F$OV.D/Z STDMETHODIMP_( ULONG ) Release( ) { ASSERT( m_uRefCount != 0U ); -- m_uRefCount; if( m_uRefCount == 0U ) { delete this; } return m_uRefCount; };
;mIn"p%mmk{Lr STDMETHODIMP QueryInterface( REFIID riid, LPVOID* ppv );
软件测试技术门户8Z8A(Ub)d STDMETHODIMP Read( void __RPC_FAR* pv, ULONG cb, ULONG __RPC_FAR* pcbRead );
软件测试技术门户"Qv"p_4BO STDMETHODIMP Write( const void __RPC_FAR* pv, ULONG cb, ULONG __RPC_FAR* pcbWritten );
软件测试技术门户R'DS#iD?void ResetPosition( ) { m_uPosition = 0U; };
软件测试技术门户f2NFb`8dPHRESULT PreAllocBuffer( ULONG uSize );
3Gt l^[*cKV[:l6jj(Rs b\S0Jvprivate:
软件测试技术门户L%`E"x_f^:M ULONG m_uRefCount; // reference count
软件测试技术门户+U*[a%~lN void* m_pBuffer; // buffer
%b`dgY?Ge U ULONG m_uBufferUsed; // buffer used
软件测试技术门户$Y ggN