ホーム » Iwao の投稿 (ページ 46)

作者アーカイブ: Iwao

2025年5月
 123
45678910
11121314151617
18192021222324
25262728293031

カテゴリー

アーカイブ

ブログ統計情報

  • 114,319 アクセス


iPhone 3D – 4

だいぶ時間が経ったが,
81 ページまでやっていて Cone が表示されない.

モデルビュー行列の設定で,”Modelview” が “ModelView” と大文字のタイプミス.

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

GeForce GT 630 に変更

T5400 のグラフィックボードを Quadro FX 570 から GeForce GT 630 に変更.
サウンドデバイスが見つからない状態になり,音が出なくなった.
セットアップ時だったか,ボードのサウンド機能を利用する様な表示があった様な?
音が出ないことはそれほど問題ないと思っていたが,Skype などが出来ない.
それとは別の要因だが CD ドライブが開かなくなってしまった.以前から調子が悪かった.
グラフィックのドライバを何とか入れ直し,設定などを見たが,特に設定はなさそう.
検索すると,BIOS の設定で回避できるとある.

Auto から On にして,再起動.
すると,音は出る様になったが,表示が…

さらに再起動して,それなりの動作となった.

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

C2582

ちょっとわかりにくいエラーメッセージだったので,…
——————–構成: Read_3D – Win32 Debug——————–
コンパイル中…
c:\…\p_a_3ds.hxx(101) : error C2582: ‘operator ‘entry’ 関数は ” 内では使用できません。
cl.exe の実行エラー
Read_3D.exe – エラー 1、警告 0


MSDN では,
コンパイラ エラー C2582
‘identifier’ : 代入演算子 ‘operator =’ が、指定されたクラスに定義されていません。
 
指定されたクラスには、代入演算子 operator=() が定義されていません。
 
クラスを引数とする代入演算子を定義している場合は、コンパイラはデフォルトの代入演算子を生成しません。
代入演算子は、各クラスに対して明示的に定義しなければなりません。代入演算子は派生クラスに継承されません。

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

OCX x64

MFC を利用した x86 の ocx の 64 ビット化.


しばらくやってないので,Win XP 32 ビット環境の VC 6 で,スケルトンの作成から.
ActiveX Controls Inside Out を見ながら,スケルトンを作成.
そのままビルドして,ActiveX コントロール テスト コンテナ で,挿入してテスト.
OnDraw のEllipse を DrawText に書換え.

  void C????Ctrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
  {
//   pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
//   pdc->Ellipse(rcBounds);
    v_tstring	buildMacros	= ::Debug_GetMacroCC_v() ;
    CString	macroStr	= ::String_Join(buildMacros,_T("\r\n")).c_str() ;
    CRect	rect = rcBounds ;
    pdc->DrawText(macroStr,rect,0) ;
    }

Debug_GetMacroCC_v は次の様なコード.

  inline	std::vector	Debug_GetMacroCC_v	(void)
  {
    std::vector	typeAry ;
    #ifdef	_WIN64
      typeAry.push_back(_T("_WIN64 ")) ;
    #elif	_WIN32
      typeAry.push_back(_T("_WIN32 ")) ;
    #endif
    // ...
    #ifdef	_MFC_VER
      typeAry.push_back(_T("_MFC_VER ")+::utot(_MFC_VER,16)+_T(" ")) ;
    #endif
    #ifdef	_UNICODE
      typeAry.push_back(_T("_UNICODE ")) ;
    #endif
    // ...
    return	typeAry ;
    }


今度は,Win 7 x64 環境で,VC 9 を利用しての確認.
「ActiveX コントロール テスト コンテナ」は,以前のバージョンとは異なり標準では存在しない.
検索するとサンプルにあるとのこと.
Win 7 環境には C:\…\VC2010Samples\C++\MFC\ole\TstCon があったので VC 10 でビルド.
VC 9 でスケルトンから作成して,OnDraw を同様に書換え.
また,構成マネージャを使用して x64 を追加.
それぞれの Release 版でビルド.
コントロールの登録は,管理者として起動した「コマンドプロンプト」で行っている.
それぞれの ocx のフォルダに移動し,regsvr32 ~.ocx として登録.
この時,ocx により?自動的に regsvr32 の 64 / 32 ビットそれぞれで登録されているみたい.

Excel 2010 で試すには,コントロールの挿入のために開発タブを有効にする必要がある.

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

String_Split

    MB MFC MB STL WC MFC WC STL
99103040 5714 0 20 0 70
99103036 14192 10 130 10 380
99103032 27636 10 400 20 1400
99103051 41128 20 900 20 3200
99103026 65388 50 2400 50 7200

単位は m sec

表では MFC と表現しているが,実際は CStringArray を利用している程度.
ちょっと意外だったのが,STL のコードで,UNICODE 版が MBCS 版の 3 倍以上になってしまっている.


STL を利用しているコードは以下の通り.
std::vector<tstring> String_Split (const tstring& str_,LPCTSTR sp=_T(" \r\n"))
{
  std::vector<tstring> strAry ;
  tstring str = str_ ;
  {
    tstring::size_type spPos = tstring::npos ;
    while ((spPos=::String_FindFirstOf(str,sp)) != tstring::npos) {
      if (str.empty()) { break ; }
      TCHAR fc = str[0] ;
      if (fc == _T(‘\"’) || fc == _T(‘\”)) { // "—" or ‘—‘
        if ((spPos=::String__Find(str,fc,1)) == tstring::npos) {
          break ;
          }
        if ((spPos = ::String_FindFirstOf(str,sp,spPos)) == tstring::npos) {
          break ;
          }
        }
      tstring splitS = str.substr(0,spPos) ;
      strAry.push_back(splitS) ;
      str = str.substr(spPos+1) ;
      if (str.empty()) { break ; }
      }
    if (!str.empty()) {
      strAry.push_back(str) ;
      }
    }
  return strAry ;
  }


String_Join も同様だが,MFC 版 StringArrayToLine1 の 1 割程度なので,このままとする.
MFC 版 StringArrayToString は十分速い.


StrAryFn.hxx

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

3DS

3DS 出力で正しくないのが生成されたので,バイナリを解析した時のメモ


http://www.dcs.ed.ac.uk/home/mxr/gfx/3d/3DS.spec
http://www.martinreddy.net/gfx/3d/3DS.spec

Chunk ID 2  
データ長 4 この次のデータの長さ + 6
データ    

 
4D4D
  3D3D
    AFFF
      A000        名称
      A020   15
        0011  9    RGB
    AFFF 
    …
    4000          名称
      4100    
        4110      頂点情報 ( WORD 頂点数 , [ float x , y , z ] )
        4140      テクスチャ ( WORD 点数 , [ float x , y ] )
        4160      
        4120      面情報 ( WORD 面数 , [ WORD 3 頂点のインデックス , WORD 面の情報 ] )
          4130    材質名 , WORD 面数 , [ WORD 面のインデックス ]
          4130        
          …
    B000      
      …


頂点数が WORD を超えていたのが原因.
PgonsA_To3DS の objIs1==TRUE で,vp3Ary.GetCount() >= 0x10000 の時,PgonsA_To3DS (…,FALSE,…) .

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

ダイアログでのEyeChange

CStatic 内に表示するには,this ではなく &m_Image とする.
// u_Zoom. Init(this,&u_Scale) ;
   u_Zoom. Init(&m_Image,&u_Scale) ;
// u_EyeChg. Init(&m_Image) ;
   u_EyeChg. Init(this) ;
   Eye eye(Eye::StdR) ;
   u_EyeChg. SetEye (eye) ;
   u_EyeChg. SetExtent(doc->PartsA_.GetExtent()) ;
   u_EyeChg. Set_MouseEyeChange(TRUE) ;
// u_Zoom. Init(this,&u_Scale,&u_EyeChg) ;
   u_Zoom. Init(&m_Image,&u_Scale,&u_EyeChg) ;
MButton , MouseWheel では,InvalidateRect などが必要.
 void CAboutDlg::OnMButtonDown(UINT nFlags, CPoint point)
 {
   if (u_EyeChg. Event(GetCurrentMessage())) { return ; }
   if (u_Zoom. Event(GetCurrentMessage())) { InvalidateRect(NULL) ; return ; }
   CDialog::OnMButtonDown(nFlags, point);
  }
 BOOL CAboutDlg::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
   if (u_EyeChg. Event(GetCurrentMessage())) { return TRUE ; }
   if (u_Zoom. Event(GetCurrentMessage())) { InvalidateRect(NULL) ; return TRUE ; }
   return CDialog::OnMouseWheel(nFlags, zDelta, pt);
  }

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

Win XP 100%

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

.NET と Win32 API

HDC の利用
IntPtr のまま与えてしまうと,
  c:\…\Form1.h(156) : error C2664: ‘DrawText’ : 1 番目の引数を ‘System::IntPtr’ から ‘HDC’ に変換できません。


  IntPtr pDC = e->Graphics->GetHdc() ;
  HDC hDC = static_cast(pDC.ToPointer()) ;
// DrawText(hDC, tstr.c_str(), -1, &rect, 0 );
  e->Graphics->ReleaseHdc(pDC) ;
ちょっと古いが,プログラミング Visual C++.NET Vol.2 P.459


コードを修正しビルドすると,
  ~.obj : error LNK2028: 未解決のトークン (0A00005B) …
  ~.obj : error LNK2019: 未解決の外部シンボル …
error LNK2028 LNK2019
「親または…」にチェックを入れる.

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

C# のコードを C++.NET で…

MSDN にあるサンプルを VC++2008 でビルドする.
MSDN 四角形内にテキストを折り返して描画する


新規プロジェクトで「Windows フォーム アプリケーション」.
「新規プロジェクト」-「Windows フォーム アプリケーション」
Paint のハンドラを追加.
Paint ハンドラの追加


private: System::Void Form1_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) {
/*
  string text2 = “Draw text in a rectangle by passing a RectF to the DrawString method.”;
  using (Font font2 = new Font(“Arial”, 12, FontStyle.Bold, GraphicsUnit.Point))
  {
    Rectangle rect2 = new Rectangle(30, 10, 100, 122);
    // Specify the text is wrapped.
    TextFormatFlags flags = TextFormatFlags.WordBreak;
    TextRenderer.DrawText(e.Graphics, text2, font2, rect2, Color.Blue, flags);
    e.Graphics.DrawRectangle(Pens.Black, Rectangle.Round(rect2));
  }
*/

  String^        text2 = “Draw text in a rectangle by passing a RectF to the DrawString method.”;
  Drawing::Font^     font2 = gcnew    Drawing::Font(“Arial”, 12, FontStyle::Bold, GraphicsUnit::Point) ;
  Drawing::Rectangle^    rect2 = gcnew    Drawing::Rectangle(30,10,100,122) ;
  TextFormatFlags        flags = TextFormatFlags::WordBreak ;
  TextRenderer::DrawText(e->Graphics,text2,font2,*rect2,Color::Blue,flags) ;
  e->Graphics->DrawRectangle(Pens::Black,*rect2) ;
}


RECT または CRect にあたるものは,Drawing::Rectangle .
ここで利用している Font は Drawing::Font としないとエラーになる.
  c:\…\drawt_2\Form1.h(87) : error C2061: 構文エラー : 識別子 ‘Font’
DrawText などの Rectangle はハンドルではなく実体.


2013/11/05
C# の文字列の前の ‘@’
リテラル文字列


MFC での文字列の変数に対する += .
  CString str ;
  str += _T(“123”) ;
C++/CLI で System::String は可能であるが,C# の string ではエラーとなるみたい.


2013/11/06
C# で g.Dispose() ;
  C++ では delete g ;
Graphics.Dispose メソッド

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

WR9500N 追加

PA-WR9500N-HP/E を購入.
8500 が動作したまま接続.IP アドレスがぶつかることは認識していたがそれなりに動作していた.
8500 を 212 に変更.
一部の機器を除いて PC 関係はほぼこれで問題なさそう.
子機の設置は後日.


Mac での,Wi-Fi の状態の確認.「option」+「Wi-Fi マーク」
mac Wi-Fi


2013/10/31 追記
子機を設置.接続したのは今の所 TV のみ.
子機の状態をブラウザで見ると,リンクアップ速度 216Mbps となっている.
今回の LAN 環境とは関係ないことではあるが,以前 Win7 のホストとその中のゲストでのファイル共有が遅かった.
ゲストの WinXP からホストのファイルへのアクセスが特に遅かったが,いつの間にか改善したみたい.


最近稼動している全 PC の設定が終わったので,8500 を外した.
残りはプリンタぐらい?


2013/12/29
DBR-T460 を追加.子機に接続.
ネットワーク上の別の TV から,レコーダーにとりためたものが見れる様になった.


2014/02/07 追記
いつだったか忘れた,うちの環境ではあまり関係ないが,
初代 PS3 (CECHB00)をいろいろいじっていると,T460 が見えた.
PS3 メディアサーバー接続
また,先日録画した BTTF を BD-RE に焼いて,PS3 で再生.
これらのことは,さすがと感じる.

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

Mavericks インストール

OS X Mavericks をインストール.
ダウンロード,再起動後のインストール時間は 44 分?の表示だったが,...
  途中で見ると,2 時間 14 分とか,1 時間 36 分とか,...
  1 分未満の表示になってから,しばらく変化がなかった.5 分位?
前回の Mountain Lion と同様 1 時間程度.
さらに再起動後 15 分程度.


VirtualBox を起動すると,
  仮想マシン”WinXP-Dev”のセッションを開けませんでした。
  Failed to open/create the internal network ‘HostInterfaceNetworking-en1’
   (VERR_SUPDRV_COMPONENT_NOT_FOUND).
  終了コード : NS_ERROR_FAILURE (0x80004005)
  コンポーネント: Console
  インターフェース: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}
Mavericks と VirtualBox で検索すると,
  VirtualBox を再インストールすれば良いとのこと.
ダウンロードフォルダにあった,VirtualBox-4.2.18-88780-OSX.dmp のインストールでうまくいった.


vdi をコピーしたいと思い,調べると VBoxManage clonehd が見つかった.
が,ちょっと面倒なのでさらに調べると,Virtual Box マネージャーにクローンがあった.
使ってみると,MAC アドレスがぶつかってしまってる.
ネットワークの設定で「高度」の中に,更新する機能があった.


2013/10/28 追記
OS のアップデート,AP の変更などいろいろあり,どれが原因か突き止められてないが,
ゲストと他の PC との接続などが安定してない.ホストとの接続もできない状態にもなった.
前回と同様に VirtualBox を再インストールすると意図した動作(他の PC が見える)にはなる.
それと,ちょっと別の困った現象.
マウス(Magic Mouse)の動作が安定しない?
ドロップダウンリストなどの時に意図しないものに切替ってしまう.

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

LAN-RPT01BK 追加

LAN-RPT01BK を追加.
設置場所が悪いのか,ちょっと不安定な気がする.
スマートフォンなので詳細がわからないが,どうも途切れることがある様な感じ.
導入前は場所によりつながらなかったので,それよりは良くなったと思われる.


その後,ノート PC での速度が遅くなったみたいで,結局外す事にした.
また,アクセスポイントの位置を 1m 程度ずらすことにより,いい感じにカバーできるようになった.


LAN-RPT01BK

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

typedef … BOOL ;

iOS のプロジェクトでビルドすると,BOOL の定義(typedef int BOOL ;)で,
  /…/i_Define.hxx:30:18: Typedef redefinition with different types (‘int’ vs ‘signed char’)
iPhoneSimulator6.1/usr/include/objc/objc.h に以下が定義されている.
  typedef signed char BOOL;


以下の様に OBJC_BOOL_DEFINED で振り分け.
  #ifdef OBJC_BOOL_DEFINED
  #else
    typedef int BOOL ;
  #endif


i_define.hxx


他にも,Mac 64-bit でビルドすると,long のビット長の問題で幾つかワーニングになる.
いい対応方法が思いつかないので,ひとまず幾つかはそのままとする.

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

C2061

既存のプロジェクトで,::To_tstring(const P2&…) を追加したら,
——————–構成: BLCombi – Win32 Debug——————–
コンパイル中…
ComPrj01.cpp
c:\…\vc98\include\memory(16) : error C2061: 構文エラー : 識別子 ‘THIS_FILE’ がシンタックスエラーを起こしました。
c:\…\vc98\include\memory(17) : error C2091: 関数は関数を返せません。
c:\…\vc98\include\memory(17) : error C2809: ‘operator new’ に仮引数リストがありません。
c:\…\vc98\include\memory(20) : error C2954: テンプレートの定義はネストできません。
c:\…\…..\blocklsv.cpp(398) : error C2678: 二項演算子 ‘+’ : 型 ‘class std::basic_string …’ の
  左オペランドを扱う演算子は定義されていません。(または変換できません)(新しい動作; ヘルプを参照)
cl.exe の実行エラー
ComPrj01.obj – エラー 5、警告 0


本来の対応は別の所にありそうだが,ComPrj01.cpp の先頭に #include <memory> を追加した.
  #include “StdAfx.h”
  #include “ComPrj00.hpp”
  #include <memory>
  …

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

VC 6 で _UNICODE

VC 6 コンソール AP で,_UNICODE を付加してビルドすると
——————–構成: T_F_Stat – Win32 ReleaseU——————–
コンパイル中…
T_F_Stat.cpp
C:\…\VC98\INCLUDE\winnt.h(195) : error C2371: ‘LPTSTR’ : 再定義されています。異なる基本型です。
  C:\…\Develop\_.SRC\__CPR_\tstring.hxx(33) : ‘LPTSTR’ の宣言を確認してください。
C:\…\VC98\INCLUDE\winnt.h(196) : error C2371: ‘LPCTSTR’ : 再定義されています。異なる基本型です。
  C:\…\Develop\_.SRC\__CPR_\tstring.hxx(34) : ‘LPCTSTR’ の宣言を確認してください。
C:\…\Develop\_.SRC\__Mlt_\Get_Path.hxx(64) : error C2664: ‘GetCurrentDirectoryA’ :
  2 番目の引数を ‘unsigned short *’ から ‘char *’ に変換できません。 (新しい機能 ; ヘルプを参照)
  指示された型は関連がありません; 変換には reinterpret_cast、 C スタイル キャストまたは関数スタイルのキャストが必要です。
C:\…\Develop\_.SRC\__Mlt_\Get_Path.hxx(91) : error C2664: ‘GetLongPathNameA’ :
  1 番目の引数を ‘const unsigned short *’ から ‘const char *’ に変換できません。 (新しい機能 ; ヘルプを参照)
  指示された型は関連がありません; 変換には reinterpret_cast、 C スタイル キャストまたは関数スタイルのキャストが必要です。
C:\…\Develop\_.SRC\__Mlt_\Get_Path.hxx(114) : error C2664: ‘GetTempPathA’ :
  2 番目の引数を ‘unsigned short *’ から ‘char *’ に変換できません。 (新しい機能 ; ヘルプを参照)
  指示された型は関連がありません; 変換には reinterpret_cast、 C スタイル キャストまたは関数スタイルのキャストが必要です。
C:\…\Develop\_.SRC\__Win\HelpWAPI.hxx(107) : error C2664: ‘GetModuleFileNameA’ :
  2 番目の引数を ‘unsigned short *’ から ‘char *’ に変換できません。 (新しい機能 ; ヘルプを参照)
  指示された型は関連がありません; 変換には reinterpret_cast、 C スタイル キャストまたは関数スタイルのキャストが必要です。
C:\…\Develop\_.SRC\__Win\HelpWAPI.hxx(143) : error C2664: ‘GetComputerNameA’ :
  1 番目の引数を ‘unsigned short *’ から ‘char *’ に変換できません。 (新しい機能 ; ヘルプを参照)
  指示された型は関連がありません; 変換には reinterpret_cast、 C スタイル キャストまたは関数スタイルのキャストが必要です。
C:\…\Develop\_.SRC\__Win\HelpWAPI.hxx(163) : error C2664: ‘GetUserNameA’ :
  1 番目の引数を ‘unsigned short *’ から ‘char *’ に変換できません。 (新しい機能 ; ヘルプを参照)
  指示された型は関連がありません; 変換には reinterpret_cast、 C スタイル キャストまたは関数スタイルのキャストが必要です。
cl.exe の実行エラー
T_F_Stat.exe – エラー 8、警告 0


tstring.h で LPxTSTR の定義は次の様にしていた.
#ifdef _MSC_VER
typedef TCHAR* LPTSTR ;
typedef const TCHAR* LPCTSTR ;
#else
typedef char* LPTSTR ;
typedef const char* LPCTSTR ;
#endif


対応方法がわからず,#include <Afx.h> を追加すると通る様にはなった.


_UNICODE だけでなく UNICODE も追加すると,Afx.h なしでも通る様になった.


2020/09 コンソール AP での define

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

fopen と sopen

_tfopen と _tsopen の mode の関係がわからなかったので,コードを抜粋
(VS8)\VC\crt\src\_open.c より
  /* First mode character must be ‘r’, ‘w’, or ‘a’. */
  switch (*mode) {
    case _T(‘r’):
      modeflag = _O_RDONLY;
      streamflag |= _IOREAD;
      break;
    case _T(‘w’):
      modeflag = _O_WRONLY | _O_CREAT | _O_TRUNC;
      streamflag |= _IOWRT;
      break;
    case _T(‘a’):
      modeflag = _O_WRONLY | _O_CREAT | _O_APPEND;
      streamflag |= _IOWRT;
      break;
    default:
      _VALIDATE_RETURN((“Invalid file open mode”,0), EINVAL, NULL);
    }


openfile.hxx
vchrfile.hxx

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

sh でエラー

sh を作成して実行すると,
  iwao@VB-Ubuntu:~/Documents$ sh mount_error.sh
  mount_error.sh: 1: mount_error.sh: sudo: not found
以前作成したものと比較したが,Ubuntu 上では見分けがつかなかった.
Windows 環境にコピーして,MIFES で開くとそれぞれで文字コードが異なる.
エラーになる sh をバイナリで開くと,EF BB BF が付加されていた.
どうも Ubuntu 上で利用したツールで,保存時に UTF-8 BOM 付としてしまったみたい.

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

Xcode でのデバッグ?

Xcode でのデバッグ
::To_tstring_rz で,str[index] = sp としていたため.
  sp はデフォルトでは _T(‘\0’) で,_T(‘ ‘) なども指定できるようにしている.
  対応としては,return する前に c_str() とすることにした.

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

ostrstream の利用でメモリリーク

次の様なコードでメモリリーク.freeze(false) がなかったのが原因.


tstring To_tstring (const double v,const int w=0,const int p=6,const long f=0) {
  tstring str ;
  std::ostrstream strBuf ;
  if (f != 0) {
    strBuf.flags(f) ;
    }
  {
    strBuf.width(w) ;
    strBuf.precision(p) ;
    }
  {
    strBuf << v ;
    strBuf << std::ends ;
    }
  {
    str = strBuf.str() ;
  // strBuf.rdbuf()->freeze(false) ;
    }
  return str ;
  }


Detected memory leaks!
Dumping objects ->
{385} normal block at 0x00038168, 512 bytes long.
Data: < 1.05 > 20 20 31 2E 30 35 00 CD CD CD CD CD CD CD CD CD
{363} normal block at 0x00037F20, 512 bytes long.
Data: <233.50 > 32 33 33 2E 35 30 00 CD CD CD CD CD CD CD CD CD
{339} normal block at 0x00037C70, 512 bytes long.
Data: < 967 > 20 20 20 39 36 37 00 CD CD CD CD CD CD CD CD CD
{315} normal block at 0x00037A28, 512 bytes long.
Data: < 875 > 20 20 20 38 37 35 00 CD CD CD CD CD CD CD CD CD
{291} normal block at 0x000377E0, 512 bytes long.
Data: < 997 > 20 20 20 39 39 37 00 CD CD CD CD CD CD CD CD CD
{269} normal block at 0x00037598, 512 bytes long.
Data: < 1.08 > 20 20 31 2E 30 38 00 CD CD CD CD CD CD CD CD CD
{245} normal block at 0x00037350, 512 bytes long.
Data: < 955 > 20 20 20 39 35 35 00 CD CD CD CD CD CD CD CD CD
{223} normal block at 0x00037108, 512 bytes long.
Data: < 1.15 > 20 20 31 2E 31 35 00 CD CD CD CD CD CD CD CD CD
{201} normal block at 0x00036EC0, 512 bytes long.
Data: < 1.02 > 20 20 31 2E 30 32 00 CD CD CD CD CD CD CD CD CD
{169} normal block at 0x000369B8, 512 bytes long.
Data: < 1.06 > 20 20 31 2E 30 36 00 CD CD CD CD CD CD CD CD CD
{143} normal block at 0x00036770, 512 bytes long.
Data: < 1003 > 20 20 31 30 30 33 00 CD CD CD CD CD CD CD CD CD
Object dump complete.
スレッド 0xDEC 終了、終了コード 0 (0x0)。
プログラム ‘C:\…\DmpFS\Debug\DmpFS.exe’ はコード 0 (0x0) で終了しました。


MSDN strstreambuf::freeze


2013/08/26
上のコードを Xcode でビルドすると,strBuf.flags(f) の所で
    /Volumes/…/t_string.hxx:47:10: No matching member function for call to ‘flags’
  利用する前に fmtflags 型にして利用する様に変更.
    std::ios_base::fmtflags f = std::ios_base::fmtflags(f_) ;


2013/08/28
_UNICODE に対応できなかったので,ostringstream を利用する様に変更.
  tstring To_tstring (const double v,const int w=0,const int p=6,const unsigned f_=std::ios::fixed) {
    tstring str ;
  #ifdef _UNICODE
    std::wostringstream strBuf ;
  #else
    std::ostringstream strBuf ;
  #endif
    std::ios_base::fmtflags f = std::ios_base::fmtflags(f_) ;
    if (f != 0) { strBuf.flags(f) ; }
    strBuf.width(w) ;
    strBuf.precision(p) ;
    strBuf << v ;
    str = strBuf.str() ;
    return str ;
    }

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