ホーム » 2014 » 6月

月別アーカイブ: 6月 2014

2014年6月
1234567
891011121314
15161718192021
22232425262728
2930  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,321 アクセス



Polymorphism

class iDocCSV1 : public iDocText {

virtual long GetFieldNo (c_tstring& fieldName) const { return FNoNOP ; }

} ;
c_tstring fieldName となっていた.


TextureTo_1::MakeCSV1 でタプルクォーテーションでうまく括られない.閉じる ‘\”‘ が付加されない.
   da.push_back(::QuotM_Add_Auto( GetPath () ) ;
原因はよくわかってないが,LPCTSTR 版を利用することで対応.
   da.push_back(::QuotM_Add_Auto( GetPath ().c_str()) ) ;
MakeCSV1 を切り出してコンソール AP としてテストしたが,期待した動作となり原因は掴めてない.


2014/06/25
また次の様なコードで,STL 版ではうまく動作していない.
{
tstring str ;
str += tt1->GetName() + _T(“\r\n”) ;
str += tt1->GetPath() + _T(“\r\n”) ;
str += tt1->GetPathPNG()+ _T(“\r\n”) ;
str += tt1->GetPathTGA()+ _T(“\r\n”) ;
m_TexPath1 = str.c_str() ;
}
MFC 版では OK .
{
CString str ;
str += tt1->GetName ().c_str() + CString(_T(“\r\n”)) ;
str += tt1->GetPath ().c_str() + CString(_T(“\r\n”)) ;
str += tt1->GetPathPNG ().c_str() + CString(_T(“\r\n”)) ;
str += tt1->GetPathTGA ().c_str() + CString(_T(“\r\n”)) ;
m_TexPath1 = str ;
}


2014/06/27
また,::String_Join_Line でうまく結合されなかった.
デバッガで調べると,サイズは確保されいる.メモリの内容をよーく見てみると,途中に ” が入っている.
原因は,MFC を利用しない方法で書き直した ::DropFilesTo のバグ.
ファイル名の最後に余分な ‘\0’ が付加されていた.

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

VC 6 MFC サポートのコンソール AP で,C4786

c:\program files\microsoft visual studio\vc98\include\utility(123) :
warning C4786: ‘std::vector<std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > >’ :
デバッグ情報で識別子が 255 文字に切り捨てられました。
StdAfx.h の #include <iostream> より前に,以下を追加して対応.

    #pragma warning (disable : 4786 )
    #include <utility>
//  #pragma warning (default : 4786 )
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

MFC DLL → Static – 2

VC 6 などで生成したプロジェクトを,VC 7 ~ VC 11 まで順に変換して利用してきたもの.
「共有 DLL で MFC を使う」から「スタティック ライブラリで MFC を使用する」に変更してビルドすると,
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\afx.h(24):
  fatal error C1189: #error : Building MFC application with /MD[d]
   (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
プロジェクトの「プロパティページ」-「構成プロパティ」-「C/C++」-「コード生成」-「ランタイム ライブラリ」を
  「マルチスレッド DLL (/MD)」から「マルチスレッド (/MT)」に変更.


ビルドは通る様になったが,起動時メインフレーム表示直後にアプリケーションエラー.
  プロジェクトのプロパティで,「リンカ」-「デバッグ」-「デバッグ情報の生成」で「はい (/DEBUG)」に.
  ビルドして実行すると,
  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\docsingl.cpp
    CSingleDocTemplate::SetDefaultTitle(CDocument* pDocument) の
       ENSURE(strDocName.LoadString(AFX_IDS_UNTITLED));
アプリケーション エラー
プロジェクトのプロパティ,「リソース」-「プリプロセッサの定義」に “_AFXDLL;” があったので削除.


2021/02/17
VC 7 以降に変換した段階で,ソースの「プリプロセッサの定義」が引き継がれてしまう?
そのため,それは削除した方が良さそう.
VC 8 「ソース」のプリプロセッサの定義
* 間違ってプロジェクトの「プリプロセッサの定義」を削除しないこと.
VC 12 LNK1104 , VC 14.2 LNK2019

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