本文介绍了BSTR到CStringT的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何将CStringT变量的内容分配给BSTR或CComBSTR变量,但是我应该如何去做呢?我有一个包含BSTR参数的C ++ Com方法.我想将该参数的内容分配给CStringT,以便能够在转换回BSTR并返回之前使用CStringT的字符串操作方法.如何初始化此CString并进行赋值?如果有的话,请发送一个代码示例.

I know how to assign the contents of a CStringT variable to a BSTR or CComBSTR variable, but how do I go the other way? I have a C++ Com method that includes a BSTR argument. I want to assign the contents of that argument to CStringT, to be able to use CStringT''s string manipulation methods before converting back to BSTR and returning. How do I initialize this CString and make the assignment? Please send a code example, if you have one. Thanks!

推荐答案

  • http://www.flounder.com/cstring.htm[^]



这篇关于BSTR到CStringT的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 12:31