CString 'Trim' : 还不是会员,为什么?

发布于 2024-09-08 05:22:38 字数 464 浏览 1 评论 0原文

我有一个简单的应用程序,我尝试使用 VC Express 进行编译并使用:
适用于 Windows Server 2003 的 Microsoft 平台 SDK,包含 MFC 和 ATL。 现在我有这个简单的代码:

CString strValue("test");
CString s = strValue.Trim();
LPCTSTR lpStr = (LPCTSTR)strValue.Trim()

这给了我一个编译错误: c:\dev\test.cpp(463) : 错误 C2039: 'Trim' : 不是 'CString' 的成员 c:\program files\microsoft platform sdk for windows server 2003 r2\include\mfc\afx.h(369) :请参阅“CString”声明

我的平台 SDK 和 vc Express 是否有问题?

I have simple app that I try to compile with VC express and using the:
Microsoft platform SDK for Windows server 2003 that contains MFC and ATL.
Now I have this simple code :

CString strValue("test");
CString s = strValue.Trim();
LPCTSTR lpStr = (LPCTSTR)strValue.Trim()

that give me a compilation error :
c:\dev\test.cpp(463) : error C2039: 'Trim' : is not a member of 'CString'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\mfc\afx.h(369) : see declaration of 'CString'

do I have a problem with the platform SDK and vc express?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

秋凉 2024-09-15 05:22:38

Visual C++ Express Edition 没有内置对 ATL 和 MFC 的支持(CString 是一个 MFC 类,作为共享 MFC/ATL CStringT 类实现:文档)。

如果您确实买不起标准版,您可以依靠此指南通过安装 DDK 来添加 ATL 和 MFC 支持:

Visual C++ Express Edition don't has built in support for ATL and MFC (CString is an MFC class, implemented as the shared MFC/ATL CStringT class: documentation).

If you really can't afford the Standard Edition, you can rely on this howto to add ATL and MFC support by installing the DDK: http://www.codeproject.com/KB/MFC/MFCinVisualStudioExpress.aspx

挽梦忆笙歌 2024-09-15 05:22:38

您可以尝试使用 CString 的 TrimLeft()、TrimRight() 函数。

You could try TrimLeft(), TrimRight() functions of CString instead.

赴月观长安 2024-09-15 05:22:38

使用“Microsoft Platform SDK for Windows Server 2003 R2”中的 MFC 似乎会安装早期版本的 MFC,其中 CString 还没有 Trim() 函数。请结合使用 TrimLeft() 和 TrimRight()。

Visual C++ 6 版本的 CString 文档的链接显示该方法尚不存在:
http://msdn.microsoft.com/en -us/library/aa315043%28v=vs.60%29.aspx

Using the MFC from the "Microsoft Platform SDK for Windows Server 2003 R2" seems to install an earlier version of MFC where CString doesn't have the Trim() function yet. Use TrimLeft() and TrimRight() in combination instead.

This link to the Visual C++ 6 version of CString documentation shows that the method doesn't exist there, yet:
http://msdn.microsoft.com/en-us/library/aa315043%28v=vs.60%29.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文