ホーム » 2023 » 9月

月別アーカイブ: 9月 2023

2023年9月
 12
3456789
10111213141516
17181920212223
24252627282930

カテゴリー

アーカイブ

ブログ統計情報

  • 81,581 アクセス



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.