ホーム » 2011 (ページ 2)

年別アーカイブ: 2011

2024年5月
 1234
567891011
12131415161718
19202122232425
262728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 81,232 アクセス



VC6→VC8→MBCS→UNICODE C4651

c:\….\masteddg.cpp(4) : warning C4651: ‘/D_MBCS’ がプリコンパイル済みヘッダーに定義されていますが、現在のコンパイル処理には定義されていません。

vcproj 内の “;_AFXDLL;_MBCS;$(NoInherit)” を削除
 _AFXDLL _MBCS $(NoInherit)


VC 7 などで追加したファイルは,以下の様にシンプル.
<File
  RelativePath=".\MastEdDg.cpp">
  </File>

これは,VC 6 で追加したもの.
<File
  RelativePath="MastS.cpp">
  <FileConfiguration
    Name="Debug|Win32">
    <Tool
      Name="VCCLCompilerTool"
      PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
      BasicRuntimeChecks="3"/>
    </FileConfiguration>
  <FileConfiguration
    Name="Release|Win32">
    <Tool
      Name="VCCLCompilerTool"
      PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"/>
    </FileConfiguration>
  </File>


2021/01
VC 12 LNK1104 , VC 14.2 LNK2019
コンパイル対象のソースをすべて選択して「プリプロセッサの定義」を
VC 2008 までは「ブランク」に.
VC 2010 以降は <親またはプロジェクトの既定値から継承> にする.

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

UNICODE と VC6 → VC8 一部修正

UNICODE と VC6 → VC8  2009/12

VC6 UNICODE

wWinMainCRTStartup

VC6 → VC8

http://cid-535f5973454c1292.skydrive.live.com/self.aspx/.Public/MFC/VC6%e2%86%92VC8.txt

「全般」-「出力ディレクトリ」,「中間ディレクトリ」 .\$(ConfigurationName)
「プリコンパイル済みヘッダファイル」 $(IntDir)/$(TargetName).pch
「C/C++」-「出力ファイル」
 「ASMリスト...」
 「オブジェクト...」
 「プログラムデータベース...」
$(IntDir)/
「リンカ」-「全般」の「出力ファイル」 $(OutDir)/$(ProjectName).exe
リンカ」-「デバッグ」
 「プログラムデータベースファイルの生成」
$(OutDir)/$(ProjectName).pdb
「リソース」-「全般」の「リソースファイル名」 $(IntDir)/$(InputName).res
「MIDL」-「出力」の「タイプライブラリ」 $(IntDir)/$(ProjectName).tlb
「ブラウザ情報」-「全般」の「出力ファイル」 $(OutDir)/$(ProjectName).bsc

 
https://dev.mish.work/Iwao/Doc/other/vs/

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

Web 接続のリモート

サーバが WIn XP
 リモート デスクトップ Web 接続をインストール
 ms-its:C:\WINDOWS\Help\rdesktop.chm::/rdesktop_install_Webcli.htm
外部にサーバを公開する
 http://www.aterm.jp/function/guide12/model/190/k/index.html
http://(サーバ名)/tsweb/

Web 経由の場合は,サーバ名を入力

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

CListCtrl の列数の取得

CListCtrl の列数の取得

  int		colCount = 0 ;
  // C:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\WinCtrl6.cpp
  // CListCtrl::GetColumnOrderArray より
  {
    CHeaderCtrl*	pCtrl = ctrl->GetHeaderCtrl() ;
    if (pCtrl != NULL)	{	colCount = pCtrl->GetItemCount() ;	}
    }

CListCtrl::GetItemCount では行数
CListCtrl レポート形式

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

smtp 587 TLS

au の基本メールアドレスを取って,手動で設定.
受信はできるが,送信でエラー.
http://www.auone-net.jp/support/various_set/mail/win/ol10/02.html
ここの step 10
  送信サーバー(SMTP)(O)       587
  使用する暗号化接続の種類(C)   TLS
これらの設定が足りなかった.

OE 6 では
  このサーバーは…接続(SSL)が必要(Q)  チェックします
  送信メール(SMTP)(O)            465


2012/11/12 追記
SMTP認証 oe 6

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

ビルドエラー fatal error C1060

VC 8 でのビルドでエラー
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(674) : fatal error C1060: ヒープの領域を使い果たしました。
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(675): クラス テンプレート のメンバ関数 ‘void CArray::AssertValid(void) const’ のコンパイル中
with
[
TYPE=Circle,
ARG_TYPE=Circle
]
\\dp340xpp\d_drive\develop\circary.hxx(79) : コンパイルされたクラスの テンプレート のインスタンス化 ‘CArray’ の参照を確認してください
with
[
TYPE=Circle,
ARG_TYPE=Circle
]

エラーメッセージの通り,不要な AP を終了することにより対応.

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

タスクバー内のアイコンが…

タスクバー内のアイコンが見えなくなった.


「休止状態」にして,復帰で,通常の表示に戻った.

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

CArray&saAry

CStringArray の配列を使用する時の制限?

c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(86) : error C2582: ‘operator ” 関数は ” 内では使用できません。
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(406) : コンパイルされたクラスのテンプレートのインスタンス化 ‘void __stdcall CopyElements(class CStringArray *,const class CStringArray *,int)’ の参照を確認してください
  以下の様なコードでコメントにした Copy があると,エラーとなる.
  {
    CArray<CStringArray,CStringArray> saAry ;
    CArray<CStringArray,CStringArray> saA ;
  // saAry.Copy(saA) ;
    }

他にもいろいろとエラーになったが,うまく抜き出せなかった.
関数などの引数として与える時に,最初 const としていたためか?
const を外して,それなりにコードを書けば通るようになったみたい.
これらを利用して書いたコードは,ListBD_C.hxx

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

BL190HW

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

CSV 関係へのリンク

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

オフラインファイルのタイムスタンプ

サーバがオフラインの時に,サーバ上のファイルを WinFile.exe で移動
 この時,更新日時が,移動(実際は同期)した日時に変更されてしまう?
 クライアント,サーバ共に Win XP SP3.

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

コンピュータ名を隠す

エクスプローラなどのネットワーク表示で,コンピュータ名を隠す
 ドメイン一覧にコンピュータが表示されないようにする
 net config server コマンド
 net config server /hidden:yes

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

CHttpFile を利用した読込みで,…

CHttpFile を利用した読込みで,接続されていなくても ReadString でそれなりに戻ってくることがあった?

以下は,あるサイトが応答しているかどうかを確認するコードの断片.
  #define W_M_P_C_ _T(“http://www.??????.com/”)
  CString rData ;
  if (!canConnectWeb && InetFile::Read(W_M_P_C_,rData)) {
    if (rData.Find(K_M_P_C_) > 0) { canConnectWeb = TRUE ; }
    connectdSite = W_M_P_C_ ;
    }

アクセスする url に,ダブらないような情報を付加することで回避.
  CString para = _T(“?_q_=”) + ::ToString(::GetTickCount()) ;
  if (!canConnectWeb && InetFile::Read(W_M_P_C_+para,rData)) {
    if (rData.Find(K_M_P_C_) > 0) { canConnectWeb = TRUE ; }
    connectdSite = W_M_P_C_ ;
    }

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

2038 対応

以下の様なコードの所では,VC 7 までは 2038 に対応していない.
time_t ????::Get???? (void)
{
  ….
  time_t term = 0 ;
  #if(_MFC_VER >= 0x0800)
    ReadBlock(…,sizeof(__time32_t)/sizeof(WORD)) ;
    __time32_t* dateBuffer = (__time32_t*)Get????Buffer() ;
    __time32_t term32 = *dateBuffer ;
    term = UINT(term32) ;
  #else
    ReadBlock(…,sizeof(time_t)/sizeof(WORD)) ;
    time_t* dateBuffer = (time_t*)Get????Buffer() ;
    term = *dateBuffer ;
  #endif
  return term ;
  }
0x7fffffff までは問題ないが,2038 を超えると VC 7 の場合,-2147483648 になる.
VC 7 LocTim64.c では,以下の様になっている.
  if ( (*ptime _MAX__TIME64_T) )
    return( NULL );
VC 6 では,long のため範囲外(LocalTim.c など)となる.
VC 8 では,2038/01/19 と認識できる.
なんで VC 8 で #ifdef としたのか?古いことなので覚えてないが,VC 7 では一部うまくないことがあったため 2038 には対応しないとした?

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

Dependency Walker , Spy , …

Dependency Walker
 http://www.dependencywalker.com/

Spy++ 8.0
 2005-09-28 10:07 140,463 spyxx.chm
 2005-12-01 03:24 496,824 spyxx.exe
 2005-09-23 02:13 73,728 spyxxhk.dll
 VC++ 2005 SP1 再頒布可能パッケージ
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

ASP 関係続き...

ログ
 AsFile.FileSys.Log(LPCTSTR message) { return ::LogMessage(message) ; }

TempFile
 AsFile.FileSys.GetDirTemp() + “TempFile.txt”
  logData = oFSys.TextFileRead(logFile)
  logData = logData & Now & vbTab & “LogData” & vbCrLf
  oFSys.TextFileWrite logFile,logData

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

しばらく使ってなかったので,…

並び替え
  ”SELECT * FROM Table_H_T_M_ ORDER BY U_1,U_2 ;”
  ”SELECT * FROM Table_H_T_M_ ORDER BY T_New,U_1,U_2 ;”
  ”SELECT * FROM Table_H_T_M_ ORDER BY T_Max,U_1,U_2 ;”
  ”SELECT * FROM Table_H_T_M_ ORDER BY H_No,U_1,N_ ;”

今回やりたいのは抽出なので WHERE
  ”SELECT * FROM Table_H_T_M_ WHERE H_No < 'M1000' ORDER BY H_No,U_1,N_ ;"
  "SELECT * FROM Table_H_T_M_ WHERE H_No LIKE ‘M0%’ ORDER BY H_No,U_1,N_ ;"

RecodeCount が -1 で返される
  デフォルトのカーソル adOpenForwardOnly
  ADO Recordset で RecordCount プロパティが -1 を返す場合
  oRS.CursorLocation = 3 ‘ adUseClient などとすれば良い
  または,oRS.Open source , connection , 3

全レコードの読み取り
  dim oRS
  set oRS = Server.CreateObject(“ADODB.recordset”)
  oRS.Open “Table” , “DSN=name”
  oRS.MoveFirst
  do while not oRS.EOF
    …
    oRS.MoveNext
  loop
  …
  oRS.Close

ASP の中止
  Response.End

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

CString::ReleaseBuffer で Assert

CString::GetBuffer を使用して,ReleaseBuffer を忘れているバグがあった.
現象は,内容をコピーした別の CString で ReleaseBuffer した時にアサート.
—————————
Microsoft Visual C++ Debug Library
—————————
Debug Assertion Failed!
Program: …\…\TInet\Debug.060\TInet.exe
File: strcore.cpp
Line: 512
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
—————————
中止(A) 再試行(R) 無視(I)
—————————
CString::ReleaseBuffer で Assert

他にも,GetLength で 0 になる.
CString::GetLength()  で 0 になる

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

DoDragDrop ですぐに抜ける?

以下の様なコードで,COleDataSource::DoDragDrop の部分がすぐ抜ける.
  CStringArray sa ;
  ::ListBoxToStringArray(m_DropList,&sa,TRUE) ;
  {
    CByteArray ba ;
    ::StringArrayToString2Z(sa,&ba) ;
    int len = ba.GetSize() ;
    HDROP hDrop = (HDROP)::GlobalAlloc(GHND,sizeof(DROPFILES) + len + sizeof(TCHAR)) ;
    if (hDrop == NULL) { return ; }
    LPDROPFILES lpdf = (LPDROPFILES)::GlobalLock(hDrop) ;
    lpdf->pFiles= sizeof(DROPFILES) ;
    lpdf->pt.x = 0 ;
    lpdf->pt.y = 0 ;
    lpdf->fNC = FALSE ;
    lpdf->fWide = FALSE ;
    #ifdef _UNICODE
    lpdf->fWide = TRUE ;
    #endif
    LPCTSTR lpFileNames = LPCTSTR(LPCSTR(lpdf)+lpdf->pFiles) ;
    memmove(LPVOID(lpFileNames),ba.GetData(),len) ;
    ::GlobalUnlock(hDrop) ;
    {
      COleDataSource* ods = new COleDataSource ;
      ods->CacheGlobalData(CF_HDROP,hDrop) ;
      ods->DoDragDrop() ;
      delete ods ;
      }
    }

AfxOleInit() を呼出していなかった.


[VC50] Windows 95 標準コントロールのドラッグアンドドロップサンプル 
http://support.microsoft.com/kb/152092/ja


2014/08/11 追記
上のコードで,delete ods はうまくない.
データ オブジェクトとデータ ソース : 作成と破棄

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

Win 7 TaskBar Pin

C:\Users\[UserName]\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

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