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

作者アーカイブ: Iwao

2025年6月
1234567
891011121314
15161718192021
22232425262728
2930  

カテゴリー

アーカイブ

ブログ統計情報

  • 117,368 アクセス


スクリプトの制限時間の変更

Active Server Pages, ASP 0113 (0x80004005)
スクリプトを実行する時間の制限を超えました。

この制限時間は、プロパティ Server.ScriptTimeout に新しい値を指定するか、IIS 管理ツールの値を変更することによって変更できます。


Active Server Pages (ASP) のスクリプト タイムアウト エラー
http://support.microsoft.com/kb/268364/ja
WinXP IIS 管理ツール


2019/12/19 Win10 環境の IIS

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

ショートカットなど

メッセージボックスの内容をクリップボードへ 「Ctrl」+「C」  
exe の起動 Windows 7 タスクバー上の「MButton」  
IE 8 ?の翻訳 「右クリック」-「...で翻訳」  
AutoRun を機能させない 「左Shift」+USB メモリ挿入   2010/02/02 追加  
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

XP Mode のインストール関係

PC が Windows XP Mode を実行できることを確認する方法 
http://www.microsoft.com/japan/windows/virtual-pc/support/configure-bios.aspx

×-仮想化機能なし 
-BIOS設定が必要 
-そのままで可能 

2010/05/20 追記
2010/03/20 以降,「仮想化テクノロジー」は必須ではなくなった.

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

Windows Sysinternals

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.

IE8 での User Agent 文字列

IE8 での User Agent 文字列
 
イントラネット内で「互換表示」が ON になっていることがある.
「ツール」-「互換表示設定」-「互換表示でイントラネット…」のチェック
 
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

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

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

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

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


VC 2022 など
ダイアログの「プロパティ」で「ファイルを受け取る」を「True」に.
「クラス ウィザード」の「メッセージ」タブで「WM_DROPFILES」を選択して「ハンドラーの追加」.
VC 2022  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


2025/02/07 内容が古かったのと,不足していたため修正
ToDIB  2025

MainFrm.h

class CMainFrame : public CFrameWnd
{
//	...
protected:  // コントロール バー用メンバ
	CStatusBar  m_wndStatusBar;
	CToolBar    m_wndToolBar;
/////////////////////////////////////////////////////////////
	CToolBar	m_wndToolZoom ;		//	拡大/縮小のツールバー
	CToolBar	m_wndToolEye1 ;		//	視点変更のツールバー
	CToolBar	m_wndToolEye2 ;		//	視点変更のツールバー
	CToolBar	m_wndToolEye3 ;		//	視点変更のツールバー
	CToolBar	m_wndToolEye4 ;		//	視点変更のツールバー
	CToolBar	m_wndToolEye5 ;		//	視点変更のツールバー
	CToolBar	m_wndToolExp1 ;
	CToolBar	m_wndToolExp2 ;
	CToolBar	m_wndToolExp3 ;
/////////////////////////////////////////////////////////////
//	...
	} ;

MainFrm.cpp

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
#ifdef	_____
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // 作成に失敗
		}
#endif
	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // 作成に失敗
		}
	// TODO: ツール バーをドッキング可能にしない場合は以下の3行を削除してください。
//	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
//	DockControlBar(&m_wndToolBar);
//	標準のツールバーの作成
	if (!CreateToolBar(this,&m_wndToolBar, IDR_MAINFRAME,_T("標準"),        AFX_IDW_DOCKBAR_TOP))  {    return  -1 ;    }
/////////////////////////////////////////////////////////////
//	if (!CreateToolBar(this,&m_wndToolZoom,IDR_TOOL_ZOOM,_T("拡大/縮小"),  0,  &m_wndToolBar))    {    return  -1 ;    }
	if (!CreateToolBar(this,&m_wndToolEye1,IDR_TOOL_EYE1,_T("固定視点"),    AFX_IDW_DOCKBAR_LEFT)) {    return  -1 ;    }
//	if (!CreateToolBar(this,&m_wndToolEye2,IDR_TOOL_EYE2,_T("視点変更")))                          {    return  -1 ;    }
//	if (!CreateToolBar(this,&m_wndToolEye3,IDR_TOOL_EYE3,_T("視点移動"),    0,  &m_wndToolBar))    {    return  -1 ;    }
	if (!CreateToolBar(this,&m_wndToolEye4,IDR_TOOL_EYE4,_T("アイソメ視点"),0, &m_wndToolEye1))    {    return  -1 ;    }
//	if (!CreateToolBar(this,&m_wndToolEye5,IDR_TOOL_EYE5,_T("目標点移動"),  0,  &m_wndToolEye2))   {    return  -1 ;    }
	if (!CreateToolBar(this,&m_wndToolExp1,IDR_TOOL_EXP1,_T("出力1"),       0,  &m_wndToolBar))    {    return  -1 ;    }
	if (!CreateToolBar(this,&m_wndToolExp2,IDR_TOOL_EXP2,_T("出力2"),       0,  &m_wndToolExp1))   {    return  -1 ;    }
	if (!CreateToolBar(this,&m_wndToolExp3,IDR_TOOL_EXP3,_T("出力3"),       0,  &m_wndToolExp2))   {    return  -1 ;    }
/////////////////////////////////////////////////////////////
//	...
	return 0;
	}
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.