MSDN中 AfxFormatString1() 函数的使用方法 -明白结贴

pzytony 2003-06-09 08:55:50
AfxFormatString1()第二个参数什么意思??

void AfxFormatString2( CString& rString, UINT nIDS, LPCTSTR lpsz1, LPCTSTR lpsz2 );

Parameters

rString

A reference to the CString that will contain the resultant string after the substitution is performed.

nIDS

The string table ID of the template string on which the substitution will be performed.

lpsz1

A string that will replace the format characters "%1" in the template string.

lpsz2

A string that will replace the format characters "%2" in the template string.

我的程序如下:

CString message = "File %1 not found";
AfxFormatString1(message,1,"C:\MYFILE.TXT");


...全文
121 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
point_to 2003-06-10
  • 打赏
  • 举报
回复
就是一个资源的ID,就像给一个图标的ID一样,可以给一个string一个ID(不给也会有默认的)。打开vc编译环境,再打开resource—》string table,就可以添加了!
pzytony 2003-06-09
  • 打赏
  • 举报
回复

请问IDS_STRING111指什么????
point_to 2003-06-09
  • 打赏
  • 举报
回复
是一个string table ID ,可以在resource里的string table里加一个比如IDS_STRING111,然后在caption里写入 file %1 not %2;
再用AfxFormatString1()函数有4个参数 第二个就是IDS_STRING111。
总之,该参数是你自己加的 。

69,336

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧