strinsrt.cpp
资源名称:shell.rar [点击查看]
上传用户:xhy777
上传日期:2007-02-14
资源大小:24088k
文件大小:4k
源码类别:
系统编程
开发平台:
Visual C++
- /*****************************************************************/
- /** Microsoft Windows for Workgroups **/
- /** Copyright (C) Microsoft Corp., 1991-1992 **/
- /*****************************************************************/
- /*
- strinsrt.cxx
- NLS/DBCS-aware string class: InsertParams method
- This file contains the implementation of the InsertParams method
- for the STRING class. It is separate so that clients of STRING which
- do not use this operator need not link to it.
- FILE HISTORY:
- Johnl 01/31/91 Created
- beng 02/07/91 Uses lmui.hxx
- */
- #include "npcommon.h"
- extern "C"
- {
- #include <netlib.h>
- }
- #if defined(DEBUG)
- static const CHAR szFileName[] = __FILE__;
- #define _FILENAME_DEFINED_ONCE szFileName
- #endif
- #include <npassert.h>
- #include <npstring.h>
- #define MAX_INSERT_PARAMS 9
- /*******************************************************************
- NAME: NLS_STR::InsertParams
- SYNOPSIS: Fill in a message string from the resource file replacing
- the number parameters with the real text.
- ENTRY: pchMessage is a pointer to the message text
- apnlsParamStrings is an array of pointers to NLS_STRs
- Example:
- *this = "Error %1 occurred, do %2, or %1 will happen again"
- apnlsParamStrings[0] = "696969"
- apnlsParamStrings[1] = "Something else"
- Return string = "Error 696969 occurred, do Something else or
- 696969 will happen again"
- EXIT: 0 if successful, error code otherwise, one of:
- WN_OUT_OF_MEMORY
- NOTES: The minimum parameter is 1, the maximum parameter is 9.
- The array of param strings must have a NULL to mark
- the end of the array.
- HISTORY:
- JohnL 01/30/91 Created
- beng 04/26/91 Uses WCHAR
- beng 07/23/91 Allow on erroneous string
- ********************************************************************/
- #define PARAM_ESC '%'
- USHORT NLS_STR::InsertParams( const NLS_STR * apnlsParamStrings[] )
- {
- if (QueryError())
- return (USHORT) QueryError();
- INT iNumParams = 0; // Number of param strings in the array
- // Max string length of expanded message (include
English
