none
CString初始化失败 RRS feed

  • 问题

  • 初始化CString字符串时,赋值为空,结果显示了电脑的当前用户名,求解?CString a = "";结果a的值为"User"。

    
    
    
    
    2018年5月9日 10:13

全部回复

  • Hi,

    thanks for posting here.

    >>初始化CString字符串时,赋值为空,结果显示了电脑的当前用户名,求解?CString a = "";结果a的值为"User"。

    听上去很不合理,请提供一下具体的上下文代码。并检查是否在其他地方对其有赋值。

    另外,尝试重新创建一个项目,只对其赋值,查看结果是否正确。

    Best Regards,

    Baron Bi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2018年5月10日 1:26
  • 应该不会的,请确认您的代码中是否有对对象a的操作?

    Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.

    2018年5月10日 1:58
    版主