Forum Discussion
If it's a .NET, WPF, Silverlight or Java application, apply .OleValue to the string object:
str = obj.GetStringValue_1().OleValue
In other application types, VarToStr(obj) might work.
Thank your for your information. It is a C++ application. I got empty string when I used VarToStr(obj).
- HKosova9 years agoSmartBear Alumni (Retired)
It's hard to tell without seeing your application. Do you know how the method signature looks in the application code? There are some limitations on native method calls, for example, returning values via reference parameters is not supported.
If you got a valid object as a result, inspect it in the Ctrl+F12 window (make sure to turn on the Show hidden members option in Tools > Options > Engines > General). There might be a property or method to access individual characters/bytes of the string, or something similar.
- fujunxu9 years agoContributor
Here is the method signature: const CString CTechBaseGrid::GetStringValue( long a_lCol, long a_lRow ) const.
I inspected the object in the "Evaluate Window" and found the value shows "[Object]". After I added it to the watch list it shows two properties: ClassName(ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >) and InstancePtr(801881552)
Thank you very much for your help!
- HKosova9 years agoSmartBear Alumni (Retired)
CStrings should have the m_pszData field that contains the actual string. You may need to switch to the advanced view to see it.
Related Content
- 7 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago