Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am facing a strange problem. I am trying to get a text from a EditBox Control, and then trying to convert that text into a _bstr_t entity.

I am using the code as _bstr_t bstrVariable = ::allocSysString(str);

and when I m doing this, I am getting only the first character in the bstrVariable.

Please note that str is not a constant string(it contains some typed data which user can edit), otherwise allocSysString() would have worked fine.

so any help on this would be appreciated. :)
Posted
Comments
nitin_roy_scorpion 6-Apr-11 13:22pm    
hi simmons,

CString str = "The string";
in above, str is a constant string, but the problem is with a generic string which stores a text from editbox.

so if you can let me know how to get the text from a Editbox Control and then convert the same to a _bsrt_t entity, so that I can use the same to populate a xml node text using MSXML2::IXMLnodeptr ptr->put_text(bstrvariable).
Please note that this bstrVariable is converted form of str variable mentioned above.

your reply on this would be a great help.

1 solution

C++
CString str = "The string";

_bstr_t bstrTest( str );

//or

_bstr_t bstrTest = _bstr_t( str ); 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900