ホーム » 2023 (ページ 2)

年別アーカイブ: 2023

2024年5月
 1234
567891011
12131415161718
19202122232425
262728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 81,628 アクセス



EnumFontFam…Proc

CALLBACK で呼び出されたものを FontType で分類して文字列の配列に登録.

#include	<Windows.h>

class	EnumFont	{
public:
	static	int	CALLBACK	CB_EnumFontFam		(const ENUMLOGFONT*   lpelf_,const NEWTEXTMETRIC*   lpntm_,DWORD font_type,LPARAM lparam) ;
	static	int	CALLBACK	CB_EnumFontFamEx	(const ENUMLOGFONTEX* lpelfe,const NEWTEXTMETRICEX* lpntme,DWORD font_type,LPARAM lparam) ;
protected:
public:
	v_tstring	Font_________ ;		//	0
	v_tstring	Font_raster__ ;		//	1	RASTER_FONTTYPE
	v_tstring	Font_device__ ;		//	2	DEVICE_FONTTYPE
	v_tstring	Font_truetype ;		//	4	TRUETYPE_FONTTYPE
	} ;

inline	int	CALLBACK	EnumFont::CB_EnumFontFam	(const ENUMLOGFONT*   lpelf_,const NEWTEXTMETRIC*   lpntm_,DWORD font_type,LPARAM p_this)
{
	const	LOGFONT&	lf = lpelf_->elfLogFont ;
	EnumFont*	pthis = (EnumFont*)p_this ;
	if      (font_type & RASTER_FONTTYPE)	{	pthis->Font_raster__.push_back(lf.lfFaceName) ;		}
	else if (font_type & TRUETYPE_FONTTYPE)	{	pthis->Font_truetype.push_back(lf.lfFaceName) ;		}
	else if (font_type & DEVICE_FONTTYPE)	{	pthis->Font_device__.push_back(lf.lfFaceName) ;		}
	else                                    	{	pthis->Font_________.push_back(lf.lfFaceName) ;		}
	return	1 ;
	}

inline	int	CALLBACK	EnumFont::CB_EnumFontFamEx	(const ENUMLOGFONTEX* lpelfe,const NEWTEXTMETRICEX* lpntme,DWORD font_type,LPARAM p_this)
{
	const	LOGFONT&	lf = lpelfe->elfLogFont ;
	EnumFont*	pthis = (EnumFont*)p_this ;
	if      (font_type & RASTER_FONTTYPE)	{	pthis->Font_raster__.push_back(lf.lfFaceName) ;		}
	else if (font_type & TRUETYPE_FONTTYPE)	{	pthis->Font_truetype.push_back(lf.lfFaceName) ;		}
	else if (font_type & DEVICE_FONTTYPE)	{	pthis->Font_device__.push_back(lf.lfFaceName) ;		}
	else                                    	{	pthis->Font_________.push_back(lf.lfFaceName) ;		}
	return	1 ;
	}

次の様に呼出し.

bool	test	(void)
{
	HWND	hWnd = ::GetConsoleWindow() ;
	HDC	hdc = ::GetDC(hWnd);
	{
		EnumFont	ef_ ;
		EnumFont	efe ;
		{
			::EnumFontFamilies  (hdc,NULL,(FONTENUMPROC)EnumFont::CB_EnumFontFam,  (LPARAM)&ef_) ;
			::EnumFontFamiliesEx(hdc,NULL,(FONTENUMPROC)EnumFont::CB_EnumFontFamEx,(LPARAM)&efe,0) ;
			}
		{
			tstring	tmp_path = ::Get_i_Tools_tmp_date() ;
			tstring	fet_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ffe_t.txt") ;
			tstring	fer_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ffe_r.txt") ;
			tstring	fed_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ffe_d.txt") ;
			tstring	fe__name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ffe__.txt") ;
			tstring	f_t_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ff__t.txt") ;
			tstring	f_r_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ff__r.txt") ;
			tstring	f_d_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ff__d.txt") ;
			tstring	f___name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_ff___.txt") ;
			::SaveText(fet_name.c_str(),efe.Font_truetype) ;
			::SaveText(fer_name.c_str(),efe.Font_raster__) ;
			::SaveText(fed_name.c_str(),efe.Font_device__) ;
			::SaveText(fe__name.c_str(),efe.Font_________) ;
			::SaveText(f_t_name.c_str(),ef_.Font_truetype) ;
			::SaveText(f_r_name.c_str(),ef_.Font_raster__) ;
			::SaveText(f_d_name.c_str(),ef_.Font_device__) ;
			::SaveText(f___name.c_str(),ef_.Font_________) ;
			}
		}
	::ReleaseDC(NULL,hdc);
	return	true ;
	}

これで出力したもの.
EnumFontFam...Proc  FontType

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

::EnumFont…

幾つかの所で使用している ::EnumFont フォント 選択
文字列 DXF 変換  2023.09
最近追加したフォントでうまく列挙されないものがある.
先日試したコード では列挙されているので,コールバック関数の部分がうまくない.
フォントを列挙する部分は 20 年以上前に書いたコード.
間違ってはなさそうだが,MFC に依存しているので見直すことに.


プログラミング Windows 第5版 を見たが,1 ページ程度.
::EnumFonts , ::EnumFontFamilies , ::EnumFontFamiliesEx の違いなどが簡単に書かれている.


当時参考にしたのは,MFC による Windows 95 プログラミング だったみたい.ソースにコメントが残っていた.


コールバック関数の EnumFontFamExProc が呼ばれるのは,::EnumFontFamiliesEx が呼ばれた直後.
EnumFontFamExProc


インストールされているフォントの列挙
インストールされているフォントの列挙


::EnumFontFamilies と ::EnumFontFamiliesEx とでは,列挙される数が異なる.
EnumFontFamilies と EnumFontFamiliesEx で列挙されるフォント

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

J2XML アンインストールでエラー

DS220 に J2XML 3.9 を入れて,更新したものを出力.
J2XML 3.9 にあげてある DS116 へのインポートは問題ないが,J2XML 3.7 では読み込めない..
それで,J2XML をアンインストールしようとするとエラー.
エラーが発生しました。   0 Joomla\Filesystem\File::delete: Failed deleting inaccessible file .htaccess
正しい対応方法がわからない.
joomla 以下の *j2xml*.* を検索して手動で削除.
どこかに情報が残っているみたいでうまくインストールできなかった.
警告 エクステンション インストール: エクステンション J2XML 3.9 はすでに存在します。
インポートに必要な部分はそれなりに入っている様で,更新分の取り込みはできる様になった.
Joomla! を 4 に更新しなければならないのかもしれない.

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

Class “JPlatform” not found

Joomla! 4 にあげてうまく動作しなかった環境
記事の一覧などに入ろうとすると
Class "JPlatform" not found
もう一つの Synology NAS で Joomla! 4 の環境が それなりに設定できた
その時 j2xml が対応してなさそうだったので,それを無効に.
j2xml を無効に
何とか記事の一覧などは表示できる様になった.
https://jml.mish.work/

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

Joomla! のメニューの追加

Joomla! などを再インストールして,記事のインポートまで行った環境.
Joomla!  Home
先頭のページは表示できるが,それぞれの記事が見られない状態.
Joomla!  The requested page can't be found.


記事の移行だけで,メニューなどはまだ追加していなかった.
Joomla!  メニューアイテムの追加


全体的に英語になっていたので…
管理画面の「システム」-「言語」.
Joomla!  「日本語」に
デフォルトを「日本語」に設定.
https://jml.mish.work/

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

AfxGetInstanceHandle

コンソール AP を変更していて「MFC を使用」にすると AfxGetInstanceHandle で ASSERT .
AfxGetInstanceHandle ASSERT

---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!

Program: c:\Temp\TOutline\tolmba\Debug.060\tolmba.exe
File: afxwin1.inl
Line: 19

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
---------------------------
中止(A)   再試行(R)   無視(I)   
---------------------------

この単体テスト用プロジェクトは,最初 MFC を使用しないでコードを書いていた.
が,幾つかの機能を付けていくと MFC を使用した既存のコードが必要になった.
その中で AfxGetInstanceHandle() を呼出している所があり,そこで ASSERT .


次の様に MFC の初期化 ::AfxWinInit を追加して対応.

int	_tmain	(int argc,TCHAR* argv[])
{
	#ifdef	_MFC_VER
	if (!::AfxWinInit(::GetModuleHandle(NULL),NULL,::GetCommandLine(),0)) {
		return	1 ;
		}
	#endif
	_tsetlocale(LC_ALL,_T("")) ;
//	...
	return	0 ;
	}
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

::EnumFontFamilies…

フォントを列挙する方法を「ChatGPT」と「Bingチャット」で問合わせてみた.


ChatGPT

#include <windows.h>
#include <iostream>

int main() {
    HDC hdc = GetDC(NULL);
    LOGFONT lf;
    memset(&lf, 0, sizeof(LOGFONT));
    lf.lfCharSet = DEFAULT_CHARSET;
    std::cout << "Available Fonts:" << std::endl;
    EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontFamiliesCallback, 0, 0);
    ReleaseDC(NULL, hdc);
    return 0;
}

int CALLBACK EnumFontFamiliesCallback(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD FontType, LPARAM lParam) {
    std::cout << lpelfe->elfFullName << std::endl;
    return 1;
}

Bingチャット

#include <windows.h>
#include <iostream>
#include <string>

int CALLBACK EnumFontFamExProc(ENUMLOGFONTEXW* lpelfe, NEWTEXTMETRICEXW* lpntme, DWORD FontType, LPARAM lParam)
{
    std::wcout << lpelfe->elfFullName << std::endl;
    return 1;
}

int main()
{
    HDC hdc = GetDC(NULL);
    LOGFONTW lf = { 0 };
    lf.lfCharSet = DEFAULT_CHARSET;
    EnumFontFamiliesExW(hdc, &lf, (FONTENUMPROCW)EnumFontFamExProc, 0, 0);
    ReleaseDC(NULL, hdc);
    return 0;
}

以前よりも精度が上がった様に感じる.
EnumFontFamilies...

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

VC 14.x での MFC のソース?

VC 2019 など最新でない VC を使用していると,MFC ソースにステップイン できなくなることがある.
VC 2019 MFC cstring.h
大抵は,インストールされている最新の MFC の場所を指定すれば良さそう.

C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.37.32822\atlmfc\include
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.37.32822\atlmfc\src\mfc

VC 2019 atlmfc src mfc


VC のアップデートがあり更新したためか,一部で「ビルド時のものと異なる」と表示されるようになった.

---------------------------
Microsoft Visual Studio
---------------------------
ソース ファイル:C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.37.32822\atlmfc\include\cstringt.h
モジュール:C:\Windows\SysWOW64\mfc140ud.dll
プロセス:[28036] GLSmth.exe
ソース ファイルがモジュールがビルドされたときのものと異なります。デバッガーでこのファイルを使用しますか?
---------------------------
はい(Y)   いいえ(N)   
---------------------------

VC 2022 MFC cstring.h
VC 2022 で試しても同様になるので,アップデートの問題か?

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

角の二等分線

https://en.wikipedia.org/wiki/Bisection
wiki にあるアニメーションをコードにしたもの.

Ld2	V2_get_bisector	(const Vd2& vp,const Vd2& vc,const Vd2& vn)
{
	//	    * vp    
	//	    |       
	//	    |       
	//	    |       * vcx
	//	    |     / 
	//	    | o /   
	//	    | / o   
	//	vc  * - - - - - - * vn
	Vd2	vcp = (vp-vc).Normalized() ;
	Vd2	vcn = (vn-vc).Normalized() ;
	Vd2	vcb = (vcp+vcn)/2. ;
	Vd2	vcx = vcb + vc ;
	{
		vcx = ::get_cross_line(vp,vn,vc,vcx) ;
		}
	Ld2	lbs(vc,vcx) ;
	return	lbs ;
	}

青い円弧が,最初の 2 行の Normalized .
次の中点を求めているのは,赤い円弧の交点を結ぶ線にあたる.
二等分線を対辺?まで延長.
二等分線
角の二等分線

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

MariaDB「データベースをリセット」

先日 Synology NAS を DSM 7.2 に更新して,困った現象があった.
実際は DSM の問題ではなく,Joomla! のバージョンが 3.10 から 4.2.9 になったとこによるもの.
記事などの一覧を表示しようとすると,エラーになってしまう.
Joomla! 4 の記事一覧などでエラー


検索などもしてみたが,いい情報に引っ掛からない.
それでいろいろと弄っていて,間違って DS116 の DB を削除してしまった
MariaDB 10  「データベースを
リセット」
Joomla! や WordPress の記事がきれいになくなってしまった.


こうなると何でもできるので,WordPress と Joomla! のパッケージを削除,再インストール.
WordPress は,完全ではないが DS220 からインポート.
Joomla! の方はこれからだが,記事の一覧などを表示できそうなところまでは確認済み.
Joomla! 4  カテゴリ一覧


データをインポートするために J2XML を使おうとするが,4.0 での対応が不明.
エクステンションのインストール画面で検索しても出てこない(All Version とすると表示はされる).
検索すると J2XML 3.9 だと対応しているみたい.
pkg_j2xml-3.9.231.zip をダウンロードして,インストール.
1 つの記事だけ 何故かダメだったが,何とかインポートまではできた.
xml の中身を見ると環境依存文字?が含まれていた.
J2XML でインポートできなかったデータ
それを削除すると何とか通った.

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

WebGL での 3D データ表示

さらに,以前作成した Web サーバ を利用して WebGL での表示に

bool	test	(void)
{
	Vd2A	pts ;
	{
		pts.push_back(Vd2(  0,  0)) ;
		pts.push_back(Vd2( 70,  0)) ;
		pts.push_back(Vd2( 90, 50)) ;
		pts.push_back(Vd2(100,100)) ;
		pts.push_back(Vd2( 50,100)) ;
		pts.push_back(Vd2( 30, 70)) ;
		pts.push_back(Vd2( 40, 30)) ;
		pts.push_back(Vd2(  0,  0)) ;
		}
	vv_PLF	vvplf ;
	{
		Vd3A	v3a = ::ToVd3A(pts) ;
		Vd4A	v4a = ::ToVd4A(v3a) ;
		PLF	plf_l(PLF::line,v4a) ;
		PLF	plf_f(PLF::face,v4a) ;
		v_PLF	v_plf ;
			v_plf.push_back(plf_l) ;
			v_plf.push_back(plf_f) ;
			vvplf.push_back(v_plf) ;
		}
	{
		tstring	tmp_path = ::Get_i_Tools_tmp_date() ;
		tstring	out_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("__.htm") ;
		tstring	outtname = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_t.htm") ;
		tstring	outnname = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T("_n.htm") ;
		{
			GonsA	gnsa = ::PLF_ToGonsA(vvplf) ;
			::GonsA_ToWGL(gnsa,out_name.c_str()) ;
				gnsa = ::GonsA_Triangulation(gnsa) ;
			::GonsA_ToWGL(gnsa,outtname.c_str()) ;
				gnsa = ::GonsA_CalcNormal   (gnsa) ;
			::GonsA_ToWGL(gnsa,outnname.c_str()) ;
			}
		{
			::start_web_server(tmp_path) ;
			}
		}
	tstring	g3_d_exe = ::get_g3_d_exe() ;
	if (!g3_d_exe.empty()) {
		tstring	tmp_path = ::Get_i_Tools_tmp_date() ;
		tstring	ipl_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T(".ipl") ;
		::To_ipl  (vvplf,ipl_name.c_str()) ;
		::start_g3_d(ipl_name.c_str()) ;
		}
	return	true ;
	}

簡易 Web サーバで WebGL

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

Linux での GLUT 3D データ表示

昨日のコードをもう少し汎用的に修正.そしてそれを他から呼出せるように変更.
次の様なコードで 3D データを生成して,GLUT で表示できる様にした.

bool	test	(void)
{
	Vd2A	pts ;
	{
		pts.push_back(Vd2(  0,  0)) ;
		pts.push_back(Vd2( 70,  0)) ;
		pts.push_back(Vd2( 90, 50)) ;
		pts.push_back(Vd2(100,100)) ;
		pts.push_back(Vd2( 50,100)) ;
		pts.push_back(Vd2( 30, 70)) ;
		pts.push_back(Vd2( 40, 30)) ;
		pts.push_back(Vd2(  0,  0)) ;
		}
	vv_PLF	vvplf ;
	{
		Vd3A	v3a = ::ToVd3A(pts) ;
		Vd4A	v4a = ::ToVd4A(v3a) ;
		PLF	plf_l__ (PLF::line,v4a) ;
		PLF	plf_f__ (PLF::face,v4a) ;
		v_PLF	v_plf ;
			v_plf.push_back(plf_l__) ;
			v_plf.push_back(plf_f__) ;
			vvplf.push_back(v_plf) ;
		}
	tstring	txt_name = ::g3_d_get_txt_name() ;
	{
		tstring	tmp_path = ::Get_i_Tools_tmp_date() ;
		tstring	ipl_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T(".ipl") ;
		::To_ipl  (vvplf,ipl_name.c_str()) ;
		::SaveText(txt_name.c_str(),ipl_name) ;
		}
	{
		::exec_g3_d(txt_name.c_str()) ;
		}
	return	true ;
	}

g3_d_gl

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

GLUT を使用した 3D データの表示

個人的なメモです.
4 年位前に作成したコードで,凹多角形がうまく処理できていないものがあったのでその変更.

#include	"glut_cg.hxx"
#include	"gonsa_to.hxx"

#define		TIMING_DN	1000

//	int	_tmain	(int argc, _TCHAR* argv[])
int		main	(int argc,   char* argv[])
{
	{
		GonsA	gnsa ;
		{
			tstring	buf ;	buf.resize(1000) ;
			while (std::terr << _T("file ? =") , std::tin.getline(&buf[0],buf.size()))
			{
				tstring	str = buf.c_str() ;
				if 	(str == _T("q"))    {	break ;		}
				else if (str == _T("Q"))    {	break ;		}
				str = ::QuotM_Del_All(str) ;
				if (str.empty())            {	continue ;	}
				if (::File_IsNothing(str))  {	continue ;	}
				tstring	in_file = str ;
				gnsa = ::To_GonsA(in_file.c_str()) ;
				gnsa = ::GonsA_Triangulation(gnsa) ;		//	2023/06/27
				gnsa = ::GonsA_CalcNormal   (gnsa) ;		//	2023/06/27
				if (gnsa.size() > 0)        {	break ;		}
				}
			if (gnsa.size() == 0)           {	return	0 ;		}
			}
		::set_GonsA(gnsa) ;
		::set_Extent(::GonsA_GetExtent(gnsa)) ;
		}
	::glutInitWindowPosition(200,200) ;
	::glutInitWindowSize    (600,400) ;
	::glutInitDisplayMode   (GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH) ;
	::glutInit              (&argc,argv) ;
	::glutCreateWindow      (argv[0]) ;
	::glutReshapeFunc       (cv_resize) ;
	::glutDisplayFunc       (cg_display) ;
	::glutKeyboardFunc      (cv_keyboard) ;
	::glutMouseFunc         (cv_mouse) ;
	::glutMotionFunc        (cv_motion) ;
	::glutTimerFunc         (TIMING_DN,cv_timer,TIMING_DN) ;
	::cv_init               () ;
	{
		::glEnable(GL_LIGHTING) ;
		::glEnable(GL_LIGHT0) ;
		}
	::glutMainLoop          () ;
	return	0 ;
	}

#include	"messbar.cxx"

t_gl_b_3.cpp
t_gl_b_3.exe

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

warning C4305:

先日次の様なコードを書いていた.塗りつぶして表示する時の色の補正.

	ColorRGB	colRGB = ::ColorRefToRGB(pgs1.GetColor()) ;
	{
		float	rgbcol = colRGB.R + colRGB.G + colRGB.B ;
		if (rgbcol < 0.20*3) {
			if (colRGB.R < 0.20)	{	colRGB.R = 0.20f ;	}
			if (colRGB.G < 0.20)	{	colRGB.G = 0.20f ;	}
			if (colRGB.B < 0.20)	{	colRGB.B = 0.20f ;	}
			}
		if (0.80*3 < rgbcol) {
			if (0.80 < colRGB.R)	{	colRGB.R = 0.80f ;	}
			if (0.80 < colRGB.G)	{	colRGB.G = 0.80f ;	}
			if (0.80 < colRGB.B)	{	colRGB.B = 0.80f ;	}
			}
		}

ColorRGB.R などは float で,RGB のそれぞれを 0.0 ~ 1.0 で表現したもの.
最初 if (colRGB.R < 0.25) { colRGB.R = 0.25 ; }  の様にしていたが,0.2 に変更した.
すると C4305 の warning .0.2f の様にすれば良いのはわかっているが,他の値で調べてみた.


0.0 , 1.0 , 7.0 などは大丈夫だが,0.2 や 7.1 は C4305 になってしまう.
warning C4305: '=' : truncation from 'const double' to 'float'
コンパイラやオプションの指定にもよると思うが,float で表現できない場合のみ warning となるのか?

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

Synology NAS DSM 7.2

Synology NAS DS220+ で DSM 7.2 に更新ができる様になっていた.
本当は DS116 で試してからにしたかったが…  DS220+ を更新した.
DSM の更新は 30 分程度.その後 Joomla! や WordPress などで 30 分.


今回の更新で,Joomla! は 3.10 から 4.2.9 に,WordPress は 5.8.3 から 6.1.1 に.
まだ全ての確認はできていないが,以前の更新と比べて影響は少なそう.
DSM 7.1DSM 7
DSM 7.2  Web Station  Web サービス

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

SetForegroundWindow

他 AP から,HWND を指定して前面に移動する方法.

bool	Window_Foreground	(HWND hWnd)
{
	if (hWnd == NULL)	{	return	false ;		}
	if (!::IsWindow(hWnd))	{	return	false ;		}
	{
		if (::IsIconic(hWnd)) {
			WINDOWPLACEMENT	wndpl = { 0 } ;
			::GetWindowPlacement(hWnd,&wndpl) ;
			wndpl.showCmd = SW_RESTORE ;
			::SetWindowPlacement(hWnd,&wndpl) ;
			}
		SetForegroundWindow(hWnd) ;
		}
	return	true ;
	}

SetForegroundWindow


CWnd::SetWindowPos(&wndTopMost,…)

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

FBX SDK 2020.3.4

Windows Update があり,それに合わせて VS も更新.
その VS のリリース情報をみると,FBX に関するものが幾つかあった.
それで FBX SDK のページを見ると 2020.3.4 があった.
今回から VS 2015 は外れ,VS 2022 までになったみたい.他にも 32 ビット版が外れている.
FBX SDK 2020.3.4

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

ゼロからの OS 自作入門 第 3 章

main.cpp のコンパイル,リンク.
$ cd ~/workspace/mikanos
$ git checkout osbook_day03a
$ cd kernel
$ clang++ -O2 -Wall -g –target=x86_64-elf -ffreestanding -mno-red-zone -fno-exceptions -fno-rtti -std=c++17 -c main.cpp
$ ld.lld –entry KernelMain -z norelro –image-base 0x100000 –static -o kernel.elf main.o
第 3 章 min.cpp コンパイル,リンク
ブートローダのビルドと実行.
$ cd ~/edk2
$ source edksetup.sh
$ build
$ ~/osbook/devenv/run_qemu.sh Build/MikanLoaderX64/DEBUG_CLANG38/X64/Loader.efi ~/workspace/mikanos/kernel/kernel.elf
第 3 章 ブートローダのビルドと実行
うまくいっているのか,ちょっとわからず.


2023/06/15
$ cd ~/workspace/mikanos
$ git checkout osbook_day03b
$ cd ~/edk2
$ source edksetup.sh
$ build
$ ~/osbook/devenv/run_qemu.sh Build/MikanLoaderX64/DEBUG_CLANG38/X64/Loader.efi ~/workspace/mikanos/kernel/kernel.elf
第 3 章 白で塗りつぶす


$ cd ~/workspace/mikanos
$ git checkout osbook_day03c
$ source ~/osbook/devenv/buildenv.sh
$ cd ~/workspace/mikanos/kernel/
$ clang++ $CPPFLAGS -O2 –target=x86_64-elf -fno-exceptions -ffreestanding -c main.cpp
$ ld.lld $LDFLAGS –entry KernelMain -z norelro –image-base 0x100000 –static -o kernel.elf main.o
$ cd ~/edk2
$ source edksetup.sh
$ build
$ ~/osbook/devenv/run_qemu.sh Build/MikanLoaderX64/DEBUG_CLANG38/X64/Loader.efi ~/workspace/mikanos/kernel/kernel.elf
第 3 章 適当な模様?
これもうまく動作しない.どうも kernel の呼出しがうまく行っていない?

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

ゼロからの OS 自作入門 第 2 章

本にある通り
$ cd ~/workspace/mikanos
$ git checkout osbook_day02a

$ cd ~/edk2
$ ln -s ~/workspace/mikanos/MikanLoaderPkg ./

$ source edksetup.sh
$ build
第 2 章 Conf/target.txt を設定していないため Failed
Conf/target.txt を「表 2.1」に変更しなければならない?


すると今度は…

build.py...
/home/iwao/edk2/MikanLoaderPkg/MikanLoaderPkg.dsc(...): error 4000: Instance of library class [RegisterFilterLib] is not found
	in [/home/iwao/edk2/MdePkg/Library/BaseLib/BaseLib.inf] [X64]
	consumed by module [/home/iwao/edk2/MikanLoaderPkg/Loader.inf]

第 2 章  error 4000 Instance of library class [RegisterFilterLib] is not foud
error 4000: Instance of library class [RegisterFilterLib] is not found」で検索すると
FAQ(よくある質問とその回答)
次の方法で対応.
$ git checkout 38c8be123aced4cc8ad5c7e0da9121a181b94251
うまくビルドできた.
第 2 章 Hello Mikan World


$ cd ~/workspace/mikanos/
$ git checkout osbook_day02b
$ cd ~/edk2/
$ source edksetup.sh
$ build
$ cd Build/MikanLoaderX64/DEBUG_CLANG38/X64/
$ ~/osbook/devenv/run_qemu.sh ./Loader.efi
第 2 章  day2b hello


2023/06/09 メモリマップの確認
第 2 章 メモリマップ

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

QNAP NAS 証明書の更新

QNAP NAS の Let’s Encrypt での証明書の更新が安定しない.
以前は,自動で更新できていた頃もあったと思う
手動で「証明書更新」としても,うまく更新できない.
今回は,代替名の ts.mish.work を外して,証明書を取得することができた.
QNAP NAS 証明書の更新

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