bufbase.cpp
资源名称:shell.rar [点击查看]
上传用户:xhy777
上传日期:2007-02-14
资源大小:24088k
文件大小:1k
源码类别:
系统编程
开发平台:
Visual C++
- /*****************************************************************/
- /** Microsoft Windows for Workgroups **/
- /** Copyright (C) Microsoft Corp., 1991-1992 **/
- /*****************************************************************/
- /* BUFBASE.CPP -- Implementation of BUFFER_BASE class.
- *
- * History:
- * 03/24/93 gregj Created base class
- *
- */
- #include "npcommon.h"
- #include "buffer.h"
- // The following code would be nice in OOP fashion, but since the
- // derived class's virtuals aren't available until after the derived
- // class's constructor is done, this Alloc() call will not go anywhere.
- // Therefore each derived class must stick the if statement in its
- // constructor.
- #if 0
- BUFFER_BASE::BUFFER_BASE( UINT cbInitial /* =0 */ )
- : _cb( 0 ) // buffer not allocated yet
- {
- if (cbInitial)
- Resize( cbInitial );
- }
- #endif
- BOOL BUFFER_BASE::Resize( UINT cbNew )
- {
- BOOL fSuccess;
- if (QuerySize() == 0)
- fSuccess = Alloc( cbNew );
- else {
- fSuccess = Realloc( cbNew );
- }
- if (fSuccess)
- _cb = cbNew;
- return fSuccess;
- }
English
