ホーム » MFC » CInternetFile::ReadString

2011年6月
 1234
567891011
12131415161718
19202122232425
2627282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,443 アクセス



CInternetFile::ReadString

CInternetFile::ReadString
CInternetFile::ReadString
VC 6 UNICODE.exe で,文字化けと,中身がうまく処理されない.MBCS.exe はOK.
文字化けは,CHAR から TCHAR への変換を正しく処理することにより対応.
それでも,まだ改行の位置で戻らず,終端も正しくない(デバッグ版ではゴミ ‘0xCD’ が入る).
どうも,VC 6 や 7 では,うまく処理できないみたい.VC 8 では期待した動作と思われる.

  CHttpConnection* pServer = pServer = session.GetHttpConnection (svrName) ;
  CHttpFile* pFile = pServer->OpenRequest (CHttpConnection::HTTP_VERB_GET,name) ;
  pFile-> SendRequest () ;
  {
    CString buf ;
    while (pFile->ReadString(buf)) {
      CString tmp = ::ToStringTC(LPCSTR(LPCTSTR(buf))) ;
      rBuf.Add(tmp) ;
      }
    ::StringArrayToString(rBuf,rData) ;
    }

http://support.microsoft.com/kb/329071
Microsoft KB Archive/329071
 PRB: CInternetFile::ReadString Does Not Convert Non-Unicode Text to Unicode Text


2019/01/31 LPCSTR , LPCWSTR からの変換
CRT_MBWC.hxx
tstrmbwc.hxx


2022/09/09 CHttpFile Read String

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

1件のコメント

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。