2024年5月
 1234
567891011
12131415161718
19202122232425
262728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 82,144 アクセス


「最近使ったもの」が表示されなくなった

以下に存在するファイルの削除で対応.
%AppData%\Microsoft\Windows\Recent\CustomDestinations
%AppData%\Microsoft\Windows\Recent\AutomaticDestinations

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.

VHD の圧縮でエラー 67

VHD の圧縮でエラーになる様になった.
[Window Title]
Windows Virtual PC
[Content]
予期しないエラー (67) が発生しました。
[OK]
VHD 圧縮 エラー 67

VPCTemporary_x.vht はそれなりのサイズ.
これを別のフォルダにコピーして,VHD にリネーム,仮想マシンとして追加すると,それなりに動作している.
どうも最後のリネームの段階で失敗しているみたい.

原因は,「WD SmartWare」が影響しているみたい.
バックアップ機能を一時的に止めることで回避.

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

DP340XPP 仮想環境

DP340XPP を移行した Virtual PC 内の環境
「Luna が有効にならない」は特に困るわけではない.Disk2VHD を使用した時はちゃんと表示できてたのにな~.
1.ブート時のChkDsk
2.Outlook Express
3.プロテクトデバイスを使用する AP
4.不要なファイルを整理,削除
5.ディスク クリーンアップ
6.デフラグ 1 回目
7.デフラグ 2 回目  ここでブルースクリーン

イベントビューアで Disk のエラーが多数あり
8.ChkDsk
9.デフラグ
10.PreCompact.exe
11.VHD の圧縮

DP340XPP-0.vhd 64.3 GB → 56.4 GB
DP340XPP-1.vhd 24.6 GB → 22.8 GB

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

DP340XPP 続き

「統合コンポーネントのインストール」が出来ない状態からの続き.
途中で,ロールバックしている様な動きだったので,…
デバイスマネージャで,うまく認識していないデバイスを削除(3 つあった).

今度は,インストールOK.
画面の解像度や色数が低い(VGA 程度).
再起動で,通常の設定が可能になった.
ただ,ホストとのマウスの行き来が出来ない.

一度,「プログラムの追加と削除」から「統合コンポーネント」をアンインストール.
再度,「統合コンポーネント」をインストール.

マウスの動作やフルスクリーンなど思った動作にはなった.

残りは,Virtual PC 環境内.
テーマの「Windows XP」にならない.
Virtual PC 環境内  テーマの「Windows XP」にならない

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

DP340XPP その後

不安定になっていた,DP340XPP を VHD にするために,HD を整理.
但し,不定期にリブートがかかる(どうもブルースクリーンになっている)ことがあるので,大きくて他の環境に存在してもいいファイルを他環境に移動.
本来はディスクのクリーンアップやデフラグなどを行った方が良かったのかもしれないが,環境が不安定なためスキップ.

Disk2VHD
DP340XPP を Disk2VHD
開始したのが 05/02 21:00 頃.C ドライブだけで,05/03 3:00 頃となったためそのまま放置.
05/03 8:30 頃見ると,リブートがかかっている.
VHD のタイムスタンプが 5:08 ,リブートがかかった時間は 5:30 頃と思われセーフ(イベントビューアで確認).

仮想マシンを作成して,2 つの VHD を割り当て.
仮想マシンとして起動.
ライセンス認証.

ここまでは良かったが,「統合コンポーネントのインストール」が出来ない.
続きは今度,…

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

WDBACW0020HBK 追加

WD My Book Essential 2TB を T54W7U64 に追加

接続すると,ドライブとしては認識するが,ドライバのエラーが 1 つ
WD SES Device だったと思う.

マニュアルをよーく読むと,HD のルートにある WD SmartWare.exe を起動して,インストール.
7 ページ 7. b または,8 ページ 9. b

ファームを更新して再起動.
SmartWare ソフトウェアを更新して再起動.

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

MS11-025 の影響?

2011/06/16 追記
2011/06/15 に MS11-025 が更新されたので,以下は古い情報になります.


 
どちらかというと,以下の影響
Microsoft Visual C++ 2005 Service Pack 1 再頒布可能パッケージ (KB2467175)
Microsoft Visual C++ 2008 Service Pack 1 再頒布可能パッケージ (KB2467174)
MS11-025

Win 7 で,AFX_IDS_~ の表示が英語になってしまう.
 Open , Save As , 印刷プレビューのボタン
 All Files (*.*)
 Failed to create empty document.
 C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\l.jpn
MS11-025 「開く」ダイアログへの影響
MS11-025 印刷プレビューのボタン

AppCore.cpp の _AfxLoadLangDLL と思うが,うまく確かめられない.
ここが呼ばれる前のコードを切り出して lcid は 1041 で,JPN が求まっている所までは確認.

デバッグ版では,MFC90JPN.dll がロードされている(デバッガやリソースモニターで確認).
C:\Windows\WinSxS\x86_microsoft.vc90.mfcloc_1fc8b3b9a1e18e3b_9.0.30729.5570_none_4977a39175471b31\MFC90JPN.DLL

リリース版に,デバッグ情報を付加して動作を見ると
SXS: Invalid parameter(s) passed to FindActCtxSection*()
 dwFlags = 0x00000001
 ReturnedData = 0018F58C
  ->cbSize = 0

FindActCtxSection を検索すると,
Visual C++ MFC and ATL FindActCtxSection
そこからのリンクは Martin’s Blog 自動翻訳


_AfxLoadLangDLL のコードを比べると,
Microsoft Visual Studio 2005 Service Pack 1 (KB2465367) 適用前
static HINSTANCE _AfxLoadLangDLL(LPCTSTR pszFormat, LPCTSTR pszPath, LCID lcid)
{
 …
 int ret;
 ATL_CRT_ERRORCHECK_SPRINTF(ret = _sntprintf_s(szLangDLL,_countof(szLangDLL),
     _countof(szLangDLL)-1,pszFormat,pszPath,szLangCode));
 if(ret == -1 || ret >= _countof(szLangDLL)) {
  ASSERT(FALSE);
  return NULL;
  }
 hInstance = ::LoadLibrary(szLangDLL);
 return hInstance;
 }

適用後
static HINSTANCE _AfxLoadLangDLL(LPCTSTR pszFormat, LPCTSTR pszPath, LCID lcid)
{
 …
 int ret;
 ATL_CRT_ERRORCHECK_SPRINTF(ret = _sntprintf_s(szLangDLL,_countof(szLangDLL),
     _countof(szLangDLL)-1,pszFormat,pszPath,szLangCode));
 if(ret == -1 || ret >= _countof(szLangDLL)) {
  ASSERT(FALSE);
  return NULL;
  }
 TCHAR *pszFilename = ::PathFindFileName(szLangDLL);
 ACTCTX_SECTION_KEYED_DATA data;
 if (FindActCtxSectionString( FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
    ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,pszFilename, &data) ) {
  // Load using the dll name only…
  hInstance = ::LoadLibraryEx(pszFilename, NULL, LOAD_LIBRARY_AS_DATAFILE);
  }
 else {    // Load using the full path…
  hInstance = ::LoadLibraryEx(szLangDLL, NULL, 0);
  }

 return hInstance;
 }

FindActCtxSectionString によって,Win 2K では動作しなくなるらしい.


2011/05/10 追記
Ted’s Blog Fixing problems with FindActCtxSectionString in MFC security updates
 static.exe での Win2K 対応と,ACTCTX_SECTION_KEYED_DATA の初期化など
 
比べてもあまり意味はないが,VC 2010 では
static HINSTANCE _AfxLoadLangDLL(LPCTSTR pszFormat, LPCTSTR pszPath, LCID lcid)
{
  TCHAR szLangDLL[_MAX_PATH+14];
  TCHAR szLangCode[4];
  HINSTANCE hInstance;
  if (lcid == LOCALE_SYSTEM_DEFAULT) {
    Checked::tcscpy_s(szLangCode, _countof(szLangCode), _T(“LOC”));
    }
  else {
    int nResult;
    nResult = ::GetLocaleInfo(lcid, LOCALE_SABBREVLANGNAME, szLangCode, 4);
    if (nResult == 0)
      return NULL;
    ASSERT( nResult == 4 );
    }
  int ret;
  ATL_CRT_ERRORCHECK_SPRINTF(ret = _sntprintf_s(szLangDLL,_countof(szLangDLL),
               _countof(szLangDLL)-1,pszFormat,pszPath,szLangCode));
  if(ret == -1 || ret >= _countof(szLangDLL)) {
    ASSERT(FALSE);
    return NULL;
    }
  hInstance = ::LoadLibraryEx(szLangDLL, NULL, 0);
  return hInstance;
  }  

pszPath は “C:\Windows\system32\” になっている.
 

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.

VC 2010 ドキュメントのプレビュー

サムネイル void CXxxDoc::OnDrawThumbnail(CDC& dc, LPRECT lprcBounds)
プレビュー void CXxxView::OnDraw(CDC* pDC)

プレビューの方はそれなりに動作している様だが,サムネイルの方はちょっと動きが違う様な?

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

Visual Studio 2010 SP1

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

文字列の輪郭を DXF に

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

ウィンドウを透明に

SetLayeredWindowAttributes

#ifndef _INC_H_HELP_USER_DLL
#define _INC_H_HELP_USER_DLL

#include <WinUser.h>

////
//*******************************************************************************
// 関数名 :SetLayeredWindowAttributes
// 作成日 :’11/01/26
//*******************************************************************************
// C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\WinUser.h より

#ifndef LWA_COLORKEY

WINUSERAPI BOOL WINAPI SetLayeredWindowAttributes(HWND hwnd,COLORREF crKey,BYTE bAlpha,DWORD dwFlags) ;
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002

inline
BOOL Hlp_SetLayeredWindowAttributes (HWND hwnd,COLORREF crKey,BYTE bAlpha,DWORD dwFlags)
{
  HMODULE hDll = ::LoadLibrary(_T(“User32.dll”)) ;
  if (hDll == NULL) { return FALSE ; }
  HRESULT (WINAPI *pfSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD) = NULL ;
  (FARPROC&)pfSetLayeredWindowAttributes = ::GetProcAddress(hDll,(“SetLayeredWindowAttributes”)) ;
  BOOL res = FALSE ;
  if (pfSetLayeredWindowAttributes != NULL) {
    res = pfSetLayeredWindowAttributes(hwnd,crKey,bAlpha,dwFlags) ;
    }
  ::FreeLibrary(hDll) ;
  return res ;
  }

#define Use_Help

#endif

////
//*******************************************************************************
// 関数名 :SetLayeredWindowAttributes
// 作成日 :’11/01/26
//*******************************************************************************

#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED 0x00080000
#endif

inline
BOOL SetLayeredWindowAttributes(CWnd*wnd,COLORREF key,BYTE alpha=128,DWORD flags=LWA_COLORKEY)
{
  if (wnd == NULL) { return FALSE ; }
  HWND hwnd = wnd->GetSafeHwnd() ;
  if (hwnd == NULL) { return FALSE ; }
  BOOL result = FALSE ;
  LONG exStyle=::GetWindowLong(hwnd,GWL_EXSTYLE) ;
  ::SetWindowLong(hwnd,GWL_EXSTYLE,exStyle|WS_EX_LAYERED) ;
  #ifdef Use_Help
    result = ::Hlp_SetLayeredWindowAttributes(hwnd,key,alpha,flags) ;
  #else
    result = ::SetLayeredWindowAttributes(hwnd,key,alpha,flags) ;
  #endif
  return result ;
  }

#endif

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

MFC 6 で CHARFORMATW

SetSelectionCharFormat では,CHARFORMATA になっている様なので

CString faceName= FontFace.GetFaceName() ;
{
  CHARRANGE selCR ;
  m_CtrlRichEdit.GetSel(selCR) ;
  {
    m_CtrlRichEdit.SetSel(0,-1) ;
    #ifdef _UNICODE
      CHARFORMATW cf ; ::ZeroMemory(&cf,sizeof(CHARFORMATW)) ; cf.cbSize = sizeof(CHARFORMATW) ;
    #else
      CHARFORMAT cf ; ::ZeroMemory(&cf,sizeof(CHARFORMAT)) ; cf.cbSize = sizeof(CHARFORMAT) ;
    #endif
    ::TcsNCpy(cf.szFaceName,LF_FACESIZE-1,faceName,LF_FACESIZE-1) ;
    cf.dwMask = CFM_FACE ;
    #ifdef _UNICODE
      m_CtrlRichEdit.SendMessage(EM_SETCHARFORMAT,SCF_SELECTION,(LPARAM)&cf) ;
    #else
      m_CtrlRichEdit.SetSelectionCharFormat(cf) ;
    #endif
    }
  m_CtrlRichEdit.SetSel(selCR) ;
  }

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

System Volume Information フォルダ

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

WinXP MS 明朝 ‘?’ TTOutline

Win 2K / XP で MS 明朝 の ‘?’ のアウトラインが綺麗でない.

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

メニューが左に…

設定を変更した記憶がないが,また,左にホップアップするようになったので...
設定は,「コントロールパネル」-「タブレット PC 設定」-「その他」タブ
メニューが左に

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

CRichEditCtrl の使用

ダイアログでCRichEditCtrlを使用する場合,InitInstanceなど,ダイアログ表示前にAfxInitRichEdit を呼び出す必要あり(これがないとダイアログが表示されない)
http://msdn.microsoft.com/ja-jp/library/76a787xf(VS.80).aspx
BOOL CXxxxApp::InitInstance()
{
 AfxEnableControlContainer();
 AfxInitRichEdit() ;
 …
 }

VC7 以降は AfxInitRichEdit2
http://msdn.microsoft.com/ja-jp/library/tt1cfb9f(v=VS.80).aspx

WinCtrl4.cpp より
BOOL PASCAL AfxInitRichEdit()
{
  _AFX_RICHEDIT_STATE* pState = _afxRichEditState;
  if (pState->m_hInstRichEdit == NULL)
  pState->m_hInstRichEdit = AfxCtxLoadLibraryW(L”RICHED32.DLL“);
  return pState->m_hInstRichEdit != NULL;
  }
BOOL PASCAL AfxInitRichEdit2()
{
  _AFX_RICHEDIT_STATE* pState = _afxRichEditState;
  if (pState->m_hInstRichEdit2 == NULL)
  pState->m_hInstRichEdit2 = AfxCtxLoadLibraryW(L”RICHED20.DLL“);
  return pState->m_hInstRichEdit2 != NULL;
  }
 
RC 内のコントロールのクラス名 RichEdit20A , RichEdit20W
http://support.microsoft.com/kb/261171
 
VC6 UNICODE exe で,CRichEditCtrl から DDX で文字列を取得すると正しく取れない.
例えば”㎡㎥m” が “㎡?m” になってしまう.
 RC のクラス名を “RICHEDIT” から “RichEdit20W” に変更して正しく取れる様になった.
CRichEditCtrl の使い方  RichEdit20W
 ”RichEdit20A” では,変わらず.
CRichEditCtrl の使い方  RichEdit20A
 
選択項目の変更の通知にはEN_SEL_CHANGEなど
これを使用する場合,OnInitDialogなどで,以下の様な呼び出しでの設定が必要.
 long       em = m_CtrlRichEdit.GetEventMask() ;
 m_CtrlRichEdit.SetEventMask(em|ENM_SELCHANGE) ;
 http://msdn.microsoft.com/ja-jp/library/bb774366.aspx
 
以下の様な方法で,FaceNameを使用可能
 CHARFORMAT  cf ;
 ::ZeroMemory(&cf,sizeof(CHARFORMAT)) ;
 cf.cbSize = sizeof(CHARFORMAT) ;
 m_CtrlRichEdit.GetSelectionCharFormat(cf) ;
 …  = cf.szFaceName ;

保存
 http://msdn.microsoft.com/ja-jp/library/b0k0ywek(v=VS.80).aspx
 

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

GetGlyphOutline

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

BrowseFile でファイル名を指定

Debug\EnvMove\RegExp\RegExpDg.cpp より
CString filter = _T(“登録ファイル (*.reg)|*.reg|All Files (*.*)|*.*||”) ;
BrowseFile  bf ;
bf.SetFilter(filter) ;
bf.SetDialogIsSave() ;
bf.SetInitialFolder(comDoc) ;
bf.SetFileName(outFile) ;
bf.SetFileName(::FolderAddLastSP(comDoc)+::GetFileName(outFile)) ;
if (bf.Browse()) {
 outFile = bf.GetSelectFile() ;
 }

BrowseFF.cxx

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