RE: converting BSTR (with embedded NULL) to CString.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: yao (yao_at_discussions.microsoft.com)
Date: 08/19/04


Date: Thu, 19 Aug 2004 15:25:03 -0700

I think you should call SetNullDiscard(false) first, then read data one by
one by bstrVal[i], it might work

"kwok" wrote:

> Hi all,
> I am working on a project that requires reading data from the serial
> port and saving the data. I and using the MSComm control to read in the data
> to a VARIANT. My problem is converting the VARIANT to a string so I could
> write it to a file. The data coming in have embedded NULL in it. So how can I
> save the data to a file and be able to read it at a later time and converted
> back to a VARIANT to send it out to a serial port?
>
> any help is appriciated..
>
> thanks in advance,
>
> Kwok



Relevant Pages

  • converting BSTR (with embedded NULL) to CString.
    ... I and using the MSComm control to read in the data ... My problem is converting the VARIANT to a string so I could ... back to a VARIANT to send it out to a serial port? ...
    (microsoft.public.vc.mfc)
  • Re: converting BSTR (with embedded NULL) to CString.
    ... CComBSTR and CString will help the conversion. ... > port and saving the data. ... My problem is converting the VARIANT to a string so I could ... > back to a VARIANT to send it out to a serial port? ...
    (microsoft.public.vc.mfc)
  • RE: converting BSTR (with embedded NULL) to CString.
    ... "kwok" wrote: ... My problem is converting the VARIANT to a string so I could ... > back to a VARIANT to send it out to a serial port? ...
    (microsoft.public.vc.mfc)
  • YAFT
    ... Trying hard to get the defaults set to what is easiest for new players. ... tried to contact Bolt Vanderhuge/Frank Galligan on whose 2001 port the FA one is ... what is variant specific and what isn't. ... The Angband maintainer can only take their needs into account up to a point. ...
    (rec.games.roguelike.angband)
  • Re: sober resurfacing
    ... Sober's previous variants access NTP on port 37, so blocking port 123 ... As long as the new variant follows the same ...
    (Focus-Microsoft)