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

作者アーカイブ: Iwao

2024年4月
 123456
78910111213
14151617181920
21222324252627
282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,435 アクセス



Excel 2007 ダブルクリックで開かない

Excel 2007
xls のダブルクリックで開かない.
 
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

ダイアログにドロップ機能の追加

「ダイアログ プロパティ」-「拡張スタイル」タブ内の「ドラッグアンドドロップを許可」にチェック.
「MFC ClassWizard」の「クラス情報」-「詳細設定オプション」の「メッセージフィルタ」を「ウィンドウ」に.
「メッセージマップ」の「メッセージ」内の WM_DROPFILES を追加.


void C???Dlg::OnDropFiles(HDROP hDropInfo) 
{
    CStringArray dropFiles ;
    ::DropFilesToStringArray(hDropInfo,dropFiles) ;
    ...
    CDialog::OnDropFiles(hDropInfo);
}
//   WinMFC.hxx
//*******************************************************************************
// 関数名 :ドロップされたファイル名の取得
// 作成日 :’07/10/19
//*******************************************************************************
BOOL DropFilesToStringArray (HDROP hDropInfo,CStringArray& strAry)
{
    UINT nFiles = ::DragQueryFile(hDropInfo,(UINT)-1,NULL,0) ;
    CStringArray dropFiles ;
    for (UINT index=0 ; index<nFiles ; index++) {
         UINT len = ::DragQueryFile(hDropInfo,index, NULL,0) ;
              len += 1 ; // 終端の NULL 文字の分を確保
         CString dropFile ;
         ::DragQueryFile(hDropInfo,index,dropFile.GetBuffer(len),len) ;
         dropFile.ReleaseBuffer() ;
         dropFiles.Add(dropFile) ;
         }
    strAry.Copy(dropFiles) ;
    return TRUE ;
    }

2014/06/02 v_tstring DropFilesTo (HDROP hDropInfo) { v_tstring dropFiles ; UINT nFiles = ::DragQueryFile(hDropInfo,(UINT)-1,NULL,0) ; for (UINT index=0 ; index<nFiles ; index++) { UINT len = ::DragQueryFile(hDropInfo,index, NULL,0) ; len += 1 ; // reserve last '\0' tstring dropFile ; dropFile.resize(len,0) ; ::DragQueryFile(hDropInfo,index,&dropFile[0],len) ; dropFiles.push_back(dropFile.c_str()) ; } return dropFiles ; }
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

IIS 環境の設定

2018/11/16 追記
 Win7 x86 に IIS
 IIS 環境の再設定
 PAtoMHD.AsPln2D を …
 RegSvr32 で ocx などの登録
 


以下は Win XP 相当の内容です.

  1. http://support.microsoft.com/?id=883607
  2. 他の環境と同様に,asp などを Inetpubwwwroot 以下にコピー.
  3. db をコピー.
  4. 「ODBC データ ソース アドミニストレータ」の「システム DSN」で追加.
  5. http://support.microsoft.com/kb/175168/ja
  6. 「コンポーネント サービス」-「DCOM の構成」で「セキュリティ」タブ内の設定.
  7. INI のアクセス権の設定. ??
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

IIS XP へのインストール

「Windows コンポーネントの追加と削除」より,IIS を追加.
 
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

SCREnc スクリプト エンコーダ

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.

CMenu::SetDefaultItem()

CMenu::SetDefaultItem() では,サブメニューに設定できない

CMenu menu ;
CMenu* pPopup = menu.GetSubMenu(0);
pPopup->SetDefaultItem(defaultID) ;

pPopup->TrackPopupMenu(flags,point.x,point.y,AfxGetMainWnd()) ;

上のコードでは,トップレベルのコマンドには可能だが,そのサブメニューには対応できない.
以下の様に順に辿っていく必要がある

//*******************************************************************************
// 関数名 :既定のメニューの設定
// 作成日 :’09/11/12
//*******************************************************************************

inline BOOL MenuMod::SetDefaultItem (CMenu* menu,const UINT defaultID)
{
 if (menu == NULL)   { return FALSE ;  }
 int  menuCount = menu->GetMenuItemCount() ;
 for (int index=menuCount-1 ; 0<=index ; index–) {
  UINT menuItemID = menu->GetMenuItemID(index) ;
  if (ID_SEPARATOR    ==menuItemID)  { continue ; } // SEPARATOR
  if (menuItemID == defaultID) {
   return menu->SetDefaultItem(index,TRUE) ;
   }
  CMenu* subMenu = menu->GetSubMenu(index) ;
  if (subMenu != NULL) {
   MenuMod::SetDefaultItem(subMenu,defaultID) ;
   }
  }
 return FALSE ;
 }

MenuMod.hxx

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

ShellExtension

CXxx::XPersistFile::Load は呼ばれるのに CXxx::XExtractIcon::GetIconLocation が呼ばれない
 
[HKEY_CLASSES_ROOTCLSID{xxxxxxxx-…xxxxxxxxxxxx}InProcServer32]
@="ExtentionDLL.dll"
"ThreadingModel"="Apartment"
 
TheredingModel を指定すれば呼ばれるようになった
 
2008/04/03 16:25
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Tool Bar のドロップダウンボタン

VC7 exe で,ビジュアルスタイルが有効な時,ツールバーの幅が正しくない
  VC7.1 もNG  VC8 以降では OK
VC6 exe で,リサイズした時ダウン
2009/06/18 10:48

http://cid-535f5973454c1292.skydrive.live.com/self.aspx/.Public/MFC/%e3%83%84%e3%83%bc%e3%83%ab%e3%83%90%e3%83%bc%e3%81%ae%e3%83%89%e3%83%ad%e3%83%83%e3%83%97%e3%83%80%e3%82%a6%e3%83%b3%e3%83%9c%e3%82%bf%e3%83%b3.txt
ツールバーのドロップダウンボタン.txt

2010/09/02 ツールバーにドロップダウンボタン

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

MFC DLL → Static

Open Dialog , Print Preview でのエラー

ダイアログの DDV でメッセージなし(アイコンのみ)

VC7 共有DLL Static DLL に変更した場合

Vista Common Ctrl 6 が有効にならない

Project . Manifest の不備

Neme = …. Project

確認済

Print Preview

DDV

「リソース」-「全般」のプリプロセッサを削除

  _AFXDLL を削除

確認済

LNK2019: 未解決の

_mainCRTStartup で..

「リンカ」-「システム」-「サブシステム」が

  設定なしになっている
  ⇒
Windows (/SUBSYSTEM:WINDOWS)

 

 ?

fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds

ソースのプロパティに _AFXDLL が含まれているのでそれを削除

 

 

補足(static 共有に戻した時)

$(NoInherit) を削除する必要もあった

 

VS2010β2 で「C++Runtime Library」を /MD /MT

確認済

2009/06/17 22:46

2009/09/16 10:45 追加

2009/10/21 10:04 追加

2009/11/27 17:20 追加

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

UNICODE と VC6 → VC8

VC6 UNICODE
 wWinMainCRTStartup

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

「プリコンパイル済みヘッダファイル」 $(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.

コンテキストメニューで MK_SHIFT , MK_CONTROL

switch (message) {
      case WM_MOUSEMOVE :    Mouse.Move(Wnd,point) ;  return TRUE ; break ;
      case WM_RBUTTONUP :    return Context (msg) ;                 break ;
      case WM_CONTEXTMENU :  return Context (msg) ;                 break ;
      case WM_COMMAND :      return Command (msg) ;                 break ;
      default :                                                     break ;
      }
//  MK_SHIFT | MK_CONTROL が押されている場合は,WM_RBUTTONUP で処理している
BOOL ????????::Context (const MSG* msg)
{
      WPARAM nFlags = GetMouseFlags (msg) ;   // キーフラグ
//    CPoint point  = GetClientPoint(msg) ;   // カーソル位置
      {
            UINT message = GetMessage(msg) ;  // メッセージ番号
            if (message == WM_RBUTTONUP) {
                  if      (nFlags & MK_CONTROL)       { ; }
                  else if (nFlags & MK_SHIFT)         { ; }
                  else                                { return FALSE ; }
                  }
            else { // WM_CONTEXTMENU の時は,キーの状態は無効
                  nFlags = 0 ;
                  }
            }
//    if (???????->PopupSelect(nFlags,point,TRUE))    { return TRUE ; }
//      ...
      }
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Windows 7 のタスクバー(進行状況バー)

VS 2010 β2
 
ITaskbarList3* GetITaskbarList3 (void)
{
      ITaskbarList3* pTL3 = NULL ;
      HRESULT   hr  = NULL ;
      hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER,IID_ITaskbarList3, (void**)&pTL3) ;
       if (hr == NOERROR) {
            return pTL3 ;
            }
      return NULL ;
      }
 
   if (TL3 != NULL) {
      TL3->SetProgressState(this->GetSafeHwnd(),TBPF_NORMAL) ;
      }
   if (TL3 != NULL) {
      TL3->SetProgressValue(this->GetSafeHwnd(),Counter,100) ;
      }
 
 
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.