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

作者アーカイブ: Iwao

2024年3月
 12
3456789
10111213141516
17181920212223
24252627282930
31  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,354 アクセス



MSB6006

ビルドで MSB6006 のエラーが発生するようになってしまった.

—— ビルド開始: プロジェクト: XxxXxXxx, 構成: Release x64 ——
XxxXxXxx.vcxproj -> \XxxXXDocumentsXxxxxxxXXXXXxxXxXxxx64_R10XxxXxXxx.exe
—— ビルド開始: プロジェクト: XxxXxXxx, 構成: Release Win32 ——
XxxXxXxx.vcxproj -> \XxxXXDocumentsXxxxxxxXXXXXxxXxXxxx86_R10XxxXxXxx.exe
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.CppCommon.targets(562,5): error MSB6006: "mt.exe" はコード 31 を伴って終了しました。
========== ビルド: 2 正常終了、1 失敗、0 更新不要、0 スキップ ==========

リビルドしても効果なし.


ファイルサーバも含め再起動をかけたら正しくビルドできるようになった.

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

explorer コマンドラインオプション

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

Visual Style を無効に

ダイアログ上のボタンなどの Visual Style を無効に
BOOL DisableVisualStyle (CWnd* wnd)

//**************************************************************************************************
// ファイル名 :HelpVSty.hxx
// 機能名  :ビジュアルスタイルヘルパ  Visual Style 関数の簡略化
// 作成者  :
// 作成年月日 :’09/07/02
// 変更履歴 :’09/07/02
//**************************************************************************************************
#ifndef _INC_H_HELP_THEME_API
#define _INC_H_HELP_THEME_API
#include <AfxWin.h>

//*******************************************************************************
// 関数名 :SetWindowTheme
// 作成日 :’09/07/02
//*******************************************************************************
inline HRESULT Hlp_SetWindowTheme (HWND hwnd,LPCWSTR pszSubAppName,LPCWSTR pszSubIdList)
{
 HMODULE hDll = ::LoadLibrary(_T("UxTheme.dll")) ;
 if (hDll == NULL)    { return !S_OK ;  }
 HRESULT (WINAPI *pfSetWindowTheme)(HWND,LPCWSTR,LPCWSTR) = NULL ;
 (FARPROC&)pfSetWindowTheme = ::GetProcAddress(hDll,("SetWindowTheme")) ;
 HRESULT res = !S_OK ;
 if (pfSetWindowTheme != NULL) {
  res = pfSetWindowTheme(hwnd,pszSubAppName,pszSubIdList) ;
  }
 ::FreeLibrary(hDll) ;
 return res ;
 }

//*******************************************************************************
// 関数名 :Visual Style を OFF に
// 作成日 :’09/07/02
//*******************************************************************************
inline BOOL DisableVisualStyle (CWnd* wnd)
{
 if (wnd == NULL)     { return FALSE ; }
 if (wnd->m_hWnd == NULL)   { return FALSE ; }
#ifdef __ATLBASE_H__
 { // コモンコントロールのバージョンをチェック
  DWORD ccMajor = 0 ;
  DWORD ccMinor = 0 ;
  AtlGetCommCtrlVersion(&ccMajor,&ccMinor) ;
  if (ccMajor < 6)    { return TRUE ; }
  }
#endif
 HRESULT res = !S_OK ;
   res = ::Hlp_SetWindowTheme(wnd->GetSafeHwnd(), L" ", L" ") ;
 return (res == S_OK) ;
 }
#endif

HelpVSty.hxx
HelpVSty.hxx

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

CStatic をはみ出さない様に

ダイアログ上の CStatic をはみ出さない様に描画する

CDC::IntersectClipRect 

   ...
   CClientDC dc(&m_Image) ;
   CRect  rect ;
   m_Image.GetClientRect(rect) ;
   dc.IntersectClipRect(rect) ;
   ...
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

VC 6 プロファイラを有効に

VC 6 で「プロファイルを行う」を有効にする設定
「プロジェクトの設定」-「リンク」タブ-カテゴリ「一般」のダイアログで,「Alt」+「E」
または,プロジェクトのオプションに "/Profile" を追加.

特定のモジュールに限定
「プロファイル」-「詳細設定」で
/EXCALL /INC ComPro01.obj /inc ComUse02.obj

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

コンボボックスの高さ指定

//*******************************************************************************
//	関数名	:コンボボックスの高さを,親ウィンドウの下に合わせる
//	作成日	:’09/07/01
//*******************************************************************************
#ifndef CBM_FIRST       // C:Program Files (x86)Microsoft SDKsWindowsv7.0AIncludeCommCtrl.h
#define CBM_FIRST               0x1700       // Combobox control messages
#define CB_SETMINVISIBLE        (CBM_FIRST + 1)
#define CB_GETMINVISIBLE        (CBM_FIRST + 2)
#define CB_SETCUEBANNER         (CBM_FIRST + 3)
#define CB_GETCUEBANNER         (CBM_FIRST + 4)
#endif

BOOL	FitDropHeight	(CComboBox* ctrl,CWnd* parent)
{
  if (ctrl == NULL)              			{	return	FALSE ;	}
  if (ctrl->m_hWnd == NULL) {	return	FALSE ;	}
  CRect	tRect ;
  ctrl->GetWindowRect (&tRect) ;
  parent->ScreenToClient(&tRect) ;
  CRect	pRect ;
  parent->GetClientRect(&pRect) ;
  tRect.bottom= pRect.bottom ;
  ctrl->MoveWindow(&tRect) ;
  	 // ここから上は,Visual Style が無効な exe の時に動作する
  {	 // ここから下は,Visual Style が有効な場合に必要	MoveWindow では変更されない?
    int	minV = tRect.Height()/ctrl->GetItemHeight(0) ;
    if (minV >= 3)	{	minV-= 2 ;	}
    if (minV <= 0)	{	minV = 1 ;	}
    ctrl->SendMessage(CB_SETMINVISIBLE,minV) ;
    }
  return	TRUE ;
  }

CB_SETCUEBANNER
CComboBox::SetCueBanner

Windows Vista コントロールの拡張


Windows Vista コモン コントロールの作成要件


サポートされなくなった ANSI API

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

DDX/DDV の順番を…

順番をいじってしまうと,入力中の最大チェックが働かなかったり,値の修正ができない様になってしまう.

 DDX_Text     (pDX, IDC_TEXT_1 , m_Text1);
 DDV_MaxChars (pDX,    m_TEXT1 , 25);
 DDX_Text     (pDX, IDC_TEXT_2 , m_Text2);
 DDV_MaxChars (pDX,    m_TEXT2 , 25);
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

x86 プロジェクトの x64 へのコピー

VC 6 以前から使用しているプロジェクトを,64 ビット用にコピーしてビルドすると以下のエラーになることがある.

1>—— ビルド開始: プロジェクト: Project, 構成: Release x64 ——
1>.x64_R10ProjectA.obj : fatal error LNK1112: モジュールのコンピューターの種類 ‘x64’ は対象コンピューターの種類 ‘X86’ と競合しています。
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========

「プロジェクトのプロパティページ」の「構成プロパティ」-「リンカ」-「コマンドライン」の「追加オプション」にある "/MACHINE:I386" を削除する.

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

MFC ファイルハンドラの登録で MSB3075

ビルド時に以下のエラーとなる.


—— ビルド開始: プロジェクト: ???Handlers, 構成: Debug Win32 ——
???Handlers.vcxproj -> C:\Users\???\Documents\Visual Studio 2010\Projects\???\Debug\???Handlers.dll
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(732,5): warning MSB3075: コマンド “regsvr32 /s “C:\Users\???\Documents\Visual Studio 2010\Projects\???\Debug\???Handlers.dll”” はコード 5 で終了しました。このコマンドを実行するための十分な権限があるか確認してください。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5): error MSB8011: 出力の登録に失敗しました。ユーザーごとのリダイレクトを有効にするか、引き上げられたアクセス許可を使用して、コマンド プロンプトからコンポーネントを登録してください。
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========


VS 2010 を「管理者として実行」して起動する.
または,「管理者として実行」した「コマンドプロンプト」での「RegSvr32」.
 
通常の「コマンドプロンプト」では以下のエラーとなる.
[Window Title]
RegSvr32
[Content]
モジュール “C:\Users\???\Documents\Visual Studio 2010\Projects\???\Debug\???Handlers.dll” は読み込まれましたが、DllRegisterServer への呼び出しはエラー コード 0x80070005 により失敗しました。
この問題の詳細については、エラー コードを検索語として入力してオンラインで検索してください。
run as administrator

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

レジストリ キーのオープンエラー

レジストリエディタで削除できないキーができてしまった.
レジストリエディタ 削除できないキー
[Window Title]
キーのオープン エラー
[Content]
・・・・….・・・・・・・・・&#29;笶,cF &#30;潺&#21;&#3;&#24;ィ&#22;&#3;$<1S を開けません。
エラーによりこのキーを開けません。
詳細: 指定されたファイルが見つかりません。
[OK]


原因は,AfxGetApp()->m_pszProfileName をいじっていた関係で,
OpenMP を利用した時のバグでごみが設定された.


対応には,RegDelNull.exe を利用.
http://technet.microsoft.com/ja-jp/sysinternals/default.aspx
http://technet.microsoft.com/ja-jp/sysinternals/bb545027.aspx
http://technet.microsoft.com/ja-jp/sysinternals/bb897448(en-us).aspx
https://docs.microsoft.com/ja-jp/sysinternals/downloads/regdelnull


RegDelNull の使い方
削除したいキー名は "HKEY_CURRENT_USER\Software\???\???\_"
環境は,Windows 7

  1. コマンドプロンプトを管理者として実行
  2. C:\Windows\system32> C:\Users\…\Regdelnull\RegDelNull.exe hkcu\Software\???\???\_
  3. 削除するか聞いてくるので,必要に応じて y

RegDelNull の使い方


2021/11
レジストリエディタ 削除中にエラーが発生しました

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

Microsoft Touch Pack

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

Release 版でのデバッグ

VC 10 で、Release 版構成にデバッグ情報を付加する.

  1. 「ビルド」-「構成マネージャー」で,「新しいプロジェクト構成」を作成.
    「設定のコピー元」を「Release」に
  2. 「プロジェクト」-「プロパティ」で,「リンカ」-「デバッグ」-「デバッグ情報の生成」を「はい」に.
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

OpenMP AfxGetMainWnd

ワーカースレッドからの AfxGetMainWnd の呼出しでは,NULL になる?
メインスレッドは正しく取得できる.

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

VC 2010 クラスウィザード

メニューの「プロジェクト」-「クラスウィザード」
Ctrl」+「Shift」+「X

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

MFC 10 再起動マネージャ

再起動マネージャのサポートの追加
http://msdn.microsoft.com/ja-jp/library/dd465232(v=VS.100).aspx

CXxxxApp::CXxxxApp()
{
#if (_MFC_VER >= 0x0A00)
     m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS ;
#endif
}

AppCore.cpp  CWinApp::CWinApp(LPCTSTR lpszAppName)
m_nAutosaveInterval = 5 * 60 * 1000; // default autosave interval is 5 minutes (only has effect if autosave flag is set)


2021/11
https://mish.myds.me/wordpress/dev/2021/11/19/restart-manager/

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

VC++ 2010 VCReDist_??.exe

VC++ 2010 の VCReDist の場所
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x86
または,
VCReDist_x86
VCReDist_x64

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

X02T メモ

留守電解除の設定
「スタート」-「設定」-「個人」-「電話」-「サービス」タブ-「転送電話」内

Wi-Fi 接続中の SoftBank メールの送受信など
一時的に止めないと,Wi-Fiが優先される

設定などで,自動的に起動(Power ON)させることは可能か?
その様な機能はない

SoftBank メールの,「メール振り分け設定」
ドメイン指定は不可
10 件まで

SoftBank メールの「未読」が常に1つ存在する
現状の対応方法としては,ハードリセットが必要 
HKEY_LOCAL_MACHINESoftwareArcsoftArcSoft MMS UAConfigUI の MMSUnreadCount を 0 に
TRE Ver.0.82 を利用(0.90 はインストールできなかった)

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

CCriticalSection と CMutex

それぞれ,500,000 回呼出した時間 (m sec) 

      P4       VirtualPC     Xeon    
CCriticalSection 734 160 94
*1 78 20 15
CMutex 8200 710 1140
*1 950 250 437
Profile          INI 2900 950 920
Reg 2100 570 740

  ElapseTick et_cs ;
  {
     CCriticalSection cs ;
     for (int index=0 ; index<500000 ; index++) {
     //CCriticalSection cs ;
        cs.Lock() ;
        cs.Unlock() ;
        }
     }
  DWORD e_cs = et_cs.GetElapse() ;

  ElapseTick et_me ;
  {
     CMutex mt ;
     for (int index=0 ; index<500000 ; index++) {
       mt.Lock() ;
       mt.Unlock() ;
       }
     }

  DWORD e_me = et_me.GetElapse() ;

  ElapseTick et_pr ;
  {
     Profile profile ;
     for (int index=0 ; index<500000 ; index++) {
       int data = profile.GetInt(_T("Test"),_T("Test"),100) ;
       }
     }
  DWORD e_pr = et_pr.GetElapse() ;

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

OpenMP エラー 1002

—————————
致命的なユーザー エラー 1002:
—————————
同一名の 1 つで ‘#pragma omp critical’ が不適切に入れ子にされています
致命的なユーザー エラー 1002: 同一名の 1 つで ‘#pragma omp critical’ が不適切に入れ子にされています
2.9 ディレクティブの入れ子
局所的になる様に,呼び出し元での “#pragma omp critical” を削除.

class Profile {
  ...
protected:
  LPCTSTR  LastProfileName ;
  CString  C_T_ProfileName ;
  ...
  } ;

BOOL Profile::SaveProfileName(void)
{
  CWinApp* app = AfxGetApp() ;
  if (app== NULL) { return FALSE ; }
  LastProfileName = AfxGetApp()->m_pszProfileName ;
  AfxGetApp()->m_pszProfileName = C_T_ProfileName ;
  return TRUE ;
  }
BOOL Profile::LoadProfileName(void)
{
  AfxGetApp()->m_pszProfileName = LastProfileName ;
  return TRUE ;
  }

omp critical ではなく,MFC 同期クラスを使用する様に変更.

//  以下は,テスト用のコード
BOOL Profile::?et??? (LPCTSTR lpszSection,LPCTSTR lpszEntry,...)
{
  ...
  CMutex m(FALSE,MN_LPN) ;
  m.Lock() ;
// return    ???Profile??? (lpszSection, lpszEntry, ...) ;
  BOOL ret = ???Profile??? (lpszSection, lpszEntry, ...) ;
  m.Unlock() ;
  return ret ;
  }
//  MFC 同期クラスの呼出しはコストがかからない様に修正する
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

OpenMP プロジェクトの設定

VC8 以降 プロジェクトのプロパティページ
「構成プロパティ」-「C/C++」-「言語」-「OpenMP サポート」を「はい」に設定.

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