ホーム » VC (ページ 12)

VC」カテゴリーアーカイブ

2024年5月
 1234
567891011
12131415161718
19202122232425
262728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,844 アクセス



Shell_NotifyIcon

SDK32: 通知領域にアイコンが登録されないことがある
http://support.microsoft.com/kb/418138/ja

マウスの位置の取得
BOOL ::GetCursorPos(LPPOINT lpPoint) ;

http://cid-535f5973454c1292.office.live.com/self.aspx/.Public/MFC/NotifyI.hxx.txt

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

タスクバーのドキュメント

mk:@MSITStore:X:MSDNShellcc.chm::/platform/Shell/Shell_Int/Taskbar.htm
http://msdn.microsoft.com/ja-jp/library/cc144179(VS.85).aspx

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

hdc が拡張メタファイルのデバイスコンテキスト?

hdc が拡張メタファイルのデバイスコンテキストかどうかを調べるには、GetObjectType 関数
GetDeviceCaps
GetObjectType

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

マルチバイト→UNICODE

「構成プロパティ」-「全般」-「文字セット」を「マルチバイト...」から「UNICODE...」に変更すると,以下のエラーになることがある.
msvcrtd.lib(wcrtexew.obj) : error LNK2019: 未解決の外部シンボル _wWinMain@16 が関数 ___tmainCRTStartup で参照されました。

vcproj をエディタなどで開き,";_MBCS;$(NoInherit)" を削除.

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

VC 8 double の配列をメモリダンプ

VC 8 で座標のデータをダンプ

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.

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.

Release 版でのデバッグ

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

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

VC6 , VC8 リモートデバッグ

VC6
mk:@MSITStore:J:MSDNvccore.chm::/html/_core_setting_up_the_remote_debug_monitor.htm
http://support.microsoft.com/kb/241848/ja
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/241848
以下のファイルをターゲット PC にコピー

1998-07-06 00:00 24,651 MSVCMON.EXE
2004-02-27 00:00 106,566 DM.DLL
2000-07-15 00:00 184,320 MSDIS110.DLL
2008-04-14 11:25 413,696 MSVCP60.DLL
2004-02-17 00:00 278,581 MSVCRT.DLL
2000-07-15 00:00  28,746 TLN0T.DLL

VC7
ms-help://MS.VSCC/MS.MSDNVS.1041/vsdebug/html/vctskInstallingRemoteDebugMonitor.htm
http://msdn.microsoft.com/ja-jp/library/aa291492(VS.71).aspx
C:\Program Files\Microsoft Visual Studio .NET\Common7\Packages\Debugger\
 msvcmon.exe
 msvcr70.dll
 NatDbgTLNet.dll
 NatDbgDM.dll
デバッグを開始できません.
プログラム ” を開始できません。
現在のユーザーのコンテキストで実行中のリモート コンピュータに MSVCMON がありません。

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Machine Debug Manager]
"AllowLaunchAsOtherUser"=dword:00000001
うまく起動できない


VC8
http://msdn.microsoft.com/ja-jp/library/ey7ec813.aspx
http://msdn.microsoft.com/ja-jp/library/ey7ec813(VS.80).aspx
http://msdn.microsoft.com/ja-jp/library/bt727f1t(VS.80).aspx
 MSVSMon.exe
 DbgHelp.dll
 MSDbgUI.dll

http://support.microsoft.com/kb/908099/ja


VC9
http://msdn.microsoft.com/ja-jp/library/bt727f1t.aspx
http://msdn.microsoft.com/ja-jp/library/bt727f1t(VS.100).aspx
 MSVSMon.exe


リモートデバッグ

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

VC7 マルチバイト→UNICODE

マルチバイトから UNICODE への変更で以下のエラーになることがある.

libcmtd.lib(wwincrt0.obj) : error LNK2019: 未解決の外部シンボル _wWinMain@16 が関数 _wWinMainCRTStartup で参照されました。

*.vcproj をエディタで開き,"$(NoInherit)" を削除

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

VS 6 の SP の確認

VS 6 の SP の確認
http://support.microsoft.com/kb/316915/ja
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/316915
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\6.0\ServicePacks

Ver.   SP MFC MSC
VS 6 VC 6 6 0x0600 1200
VS .net VC 7 1 0x0700 1300
VS 2003 VC 7.1 1 0x0710 1310
VS 2005 VC 8 1 0x0800 1400
VS 2008 VC 9 1 0x0900 1500
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

複数のツールバーを横に並べて作成

//*******************************************************************************
// 関数名 :ツールバーの作成の後処理
// 作成日 :’05/06/16
// 変更日 :’07/04/06
//*******************************************************************************
// MFC\General\DockTool\MainFrm.cpp DockControlBarLeftOf より
BOOL	ToolBar::CreateDocking	(
	CFrameWnd*	frameW,
	CToolBar*	toolBar,
	UINT		idr,
	CString		title,
	UINT		barID,
	CToolBar*	last,
	const	BOOL	canFloat		//	フローティング可能かどうか
	)
{
	toolBar->SetWindowText(title) ;                                            	//  ウィンドウタイトルの設定
//	toolBar->SetBarStyle(toolBar->GetBarStyle()|CBRS_TOOLTIPS|CBRS_FLYBY) ;  	//  ツール チップなどの付加
	toolBar->EnableDocking(CBRS_ALIGN_ANY) ;                                       	//  ドッキング可能に
	Resize(toolBar,idr) ;	//	ツールバーのリサイズ
	{	//	ツールバーの位置を決定する
		static	CToolBar*		LastToolBar = NULL ;			//  前のツールバーの位置
		if (last != NULL)	{	LastToolBar = last ;	}		//  前のツールバーが指定された
		if (LastToolBar == NULL || barID != 0) {
			CControlBar*	pDockBar = frameW->GetControlBar(barID) ;
			if (pDockBar != NULL && canFloat) {
				frameW->DockControlBar(toolBar,barID) ;
				}
			}
		else {
			frameW->RecalcLayout() ;
			CRect		rect ;
			LastToolBar->GetWindowRect(&rect);
			rect.OffsetRect(1,1);
			DWORD		dw = LastToolBar->GetBarStyle();
			UINT		tBarID = 0 ;
			tBarID = (dw&CBRS_ALIGN_TOP)	            	?  AFX_IDW_DOCKBAR_TOP    : tBarID ;
			tBarID = (dw&CBRS_ALIGN_BOTTOM	&& tBarID==0)	?  AFX_IDW_DOCKBAR_BOTTOM : tBarID ;
			tBarID = (dw&CBRS_ALIGN_LEFT	&& tBarID==0)	?  AFX_IDW_DOCKBAR_LEFT   : tBarID ;
			tBarID = (dw&CBRS_ALIGN_RIGHT	&& tBarID==0)	?  AFX_IDW_DOCKBAR_RIGHT  : tBarID ;
			CControlBar*	pDockBar = frameW->GetControlBar(tBarID) ;
			if (pDockBar != NULL && canFloat) {
				frameW->DockControlBar(toolBar,tBarID,&rect) ;
				}
			}
		LastToolBar = toolBar ;				//  次のツールバーの位置を求めるために保存しておく
		}
	return	TRUE ;
	}

http://cid-535f5973454c1292.skydrive.live.com/embedicon.aspx/.Public/MFC/ToolBar.hxx
ToolBar.hxx


ToolBar.hxx

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