Re: LPCWSTR to CString conversion problem



"Rohit Kumar" <RohitKumar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:95D7082C-4540-41A2-B485-E866F903C030@xxxxxxxxxxxxx
I am using xmllite methods for reading from an xml file inside my
interface method. There is a function IXmlReader::GetValue which
returns the value of the xml element. The return value is an LPCWSTR.
When i try assigning it to a CString and use the first element of
that cstring using getat(1) then it returns a garbage value.

GetAt(1) returns the second character of the string, not the first. Are
you sure the string is long enough? What exactly do you mean by "garbage
value"?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: SQL Server NULL => XML Element
    ... > first element in the child sequence group, ... >> Why is it that some SQL Server NULLs are sometimes returned in the ... >> XML element in the XML schema is moved up or down within the enclosing ...
    (microsoft.public.sqlserver.xml)
  • Re: What up with this?
    ... > Why is the string test always empty? ... good reasons for this. ... It's consistent with the definition of an XML element in the W3C's DOM ... What you probably mean to obtain in the string, test, is the value of the child ...
    (microsoft.public.dotnet.xml)
  • RE: Web Method Parameters
    ... Do you know which parameter is causing the null reference exception? ... possible that the string is NOT an XML element (this would be unusual, ... >After having used SetBodyObject to serialize a string into the body (after ... >> payload before it gets encrypted on the wire to verify this, as the SSL ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: subroutines with XML
    ... > references to Perl subroutines. ... The advice usually goes on "...use a hash instead". ... they will stringify to a unique string. ... Later, given an XML element $element, you can call the code like this: ...
    (comp.lang.perl.misc)
  • Re: old to new
    ... use a loop to compare each string to the value you're searching for. ... If you find it store the array position in a variable you can use later. ... -- Couldn't help but notice you're 'assuming' the xml element will be ...
    (microsoft.public.scripting.vbscript)