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

作者アーカイブ: Iwao

2024年5月
 1234
567891011
12131415161718
19202122232425
262728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 82,122 アクセス


XML の書出しテスト – 5

MSXML.dll を利用しない方法を用意.
//#include “Xml_MS_.hxx”
#include “XmlOut.hxx”
#include “SvgOut.hxx”


class    Xml_Attribute    {
public:
//    …
protected:
CString        Name ;
CString        Value ;
} ;

class    XmlOut_E    {
public:
//    …
protected:
CString                                Name ;
CString                                Text ;
CArray<Xml_Attribute,Xml_Attribute>    Attribute ;
protected:
CArray<XmlOut_E,XmlOut_E>            Child ;
} ;

inline
BOOL    XmlOut::Export    (const XmlOut_E& elements,LPCTSTR svgName)
{
#ifdef    UseMSXML
return    Xml_MS::Export(elements,svgName) ;
#endif
CStringArray    strAry ;
{
#ifdef        _UNICODE
CString        xml_ver = _T(“<?xml version=\”1.0\” encoding=\”utf-16\”?>”) ;
#else
CString        xml_ver = _T(“<?xml version=\”1.0\” encoding=\”Shift-JIS\”?>”) ;
#endif
strAry.Add(    xml_ver) ;
}
{
CStringArray    sa ;
CreateElement(elements,&sa,0) ;
strAry.Append(sa) ;
}
return    ::SaveText(svgName,strAry,TRUE) ;
}

inline
BOOL    XmlOut::CreateElement    (const XmlOut_E& elements,CStringArray* sa,const int indent)
{
CString    tab = _T(“\t\t\t\t\t\t\t\t\t\t\t\t\t”) ;
CStringArray    strAry ;
int                nowIndent = indent ;
if (elements.IsComment()) {
sa->Add(tab.Left(indent) + _T(“<!–“)+elements.GetText()+_T(“–>”)) ;
return    TRUE ;
}
CString    eleStr ;
{
eleStr = tab.Left(indent) + _T(“<“) + elements.GetName() + _T(” “) ;
CString    attStr ;
for (int aIndex=0 ; aIndex<elements.GetAttributeCount() ; aIndex++) {
Xml_Attribute    a = elements.GetAttribute(aIndex) ;
CString    name = a.GetName () ;
CString    value= a.GetValue() ;
attStr += name + _T(“=\””) + value + _T(“\”\t”) ;
}
if (!attStr.IsEmpty()) {
eleStr += attStr ;
}
CString    nameOrChild ;
if (!elements.GetText().IsEmpty()) {
nameOrChild = elements.GetText() ;
eleStr += _T(” >”) + nameOrChild ;
}
else {
CStringArray    saChild ;
for (int cIndex=0 ; cIndex<elements.GetChildCount() ; cIndex++) {
XmlOut_E        c = elements.GetChild(cIndex) ;
CreateElement(c,&saChild,indent+1) ;
}
if (saChild.GetSize() > 0) {
::StringArrayToString(saChild,nameOrChild) ;
eleStr += _T(” >\r\n”) + nameOrChild ;
}
}
if (nameOrChild.IsEmpty()) {
eleStr += _T(“/>”) ;
}
else {
if (!elements.GetText().IsEmpty()) {
eleStr +=                         _T(“</”) + elements.GetName() + _T(“>”) ;
}
else {
eleStr += tab.Left(indent+1) + _T(“</”) + elements.GetName() + _T(“>”) ;
}
}
strAry.Add(eleStr) ;
}
return    sa->Append(strAry) ;
}

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

xmlns を間違えて 0xE06D7363

xmlns の所を xmlne とタイプミス.そのまま実行して 0xE06D7363.
0xE06D7363
0xE06D7363
—————————
Microsoft Visual C++
—————————
ハンドルされていない例外 は T_xml_7.exe (KERNEL32.DLL) にあります: 0xE06D7363: Microsoft C++ Exception。
—————————
OK
—————————
通常の実行の場合は,
Abnormal Program Termination
—————————
Microsoft Visual C++ Debug Library
—————————
Debug Error!
Program: …NGS\ALL USERS\DOCUMENTS\VC_TEST\SVG\T_xml_7\Debug\T_xml_7.exe
abnormal program termination

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

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

コンパイルで C4786

——————–構成: T_xml_7 – Win32 Debug——————–
コンパイル中…
T_xml_7.cpp
c:\documents and settings\all users\documents\develop\____test\xmlout.hxx(69) : warning C4786: ‘__ehhandler$?Add_Attribute@XmlOut@@SAHV?$_com_ptr_t@V?$_com_IIID@UIXMLDOMDocument@MSXML@@$1?_GUID_2933bf81_7b36_11d2_b20e_00c04f983e60@@3U__s_GUID@@A@@@@
V?$_com_ptr_t@V?$_com_IIID@UIXMLDOMElement@MSXML@@$1?_GUID_2933bf86_7b36_11d2_b20e_00c04f983e60@@3U__s_GUID@@A@@@@PBD2@Z’ : デバッグ情報で識別子が 255 文字に切り捨てられました。
...
リンク中…
T_xml_7.exe – エラー 0、警告 6

コードは以下の部分.
  inline
  BOOL XmlOut::Add_Attribute (
        MSXML::IXMLDOMDocumentPtr pDoc,
        MSXML::IXMLDOMElementPtr pEle,
        LPCTSTR name,LPCTSTR value)
  {
    if (pDoc == NULL) { return FALSE ; }
    if (pEle == NULL) { return FALSE ; }
    MSXML::IXMLDOMAttributePtr pAtt = pDoc->createAttribute(name) ;
    pAtt->value = value ;
    pEle->setAttributeNode(pAtt) ;
    return TRUE ;
    }

前後に,
  #pragma warning (disable : 4786 )

  #pragma warning (default : 4786 )
を付加.

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

XML の書出しテスト – 4

xmlns="" が付加されない方法がわからなかったので,逆に svg:svg などと出力する様に変更.
<?xml version="1.0" encoding="utf-8"?>
<!–SVG 出力テスト–>
<svg:svg width="50%" height="50%" viewBox="0 0 100 100" xmlns:svg="http://www.w3.org/2000/svg">
<svg:g stroke="red" stroke-width="0.3" stroke-dasharray="3 3">
<svg:line x1="0" x2="0" y1="10" y2="90"/>
<svg:line x1="10" x2="10" y1="10" y2="90"/>
<svg:line x1="20" x2="20" y1="10" y2="90"/>
<svg:line x1="30" x2="30" y1="10" y2="90"/>
<svg:line x1="40" x2="40" y1="10" y2="90"/>
</svg:g>
</svg:svg>


BOOL    TestXML    (void)
{
HRESULT    hr = ::CoInitialize(NULL) ;
if (FAILED(hr))            {    return    FALSE ;        }
{
MSXML::IXMLDOMDocumentPtr    pDoc = NULL ;
hr = pDoc.CreateInstance(MSXML::CLSID_DOMDocument) ;
if (FAILED(hr))        {    return    FALSE ;        }
MSXML::IXMLDOMProcessingInstructionPtr pi = pDoc->createProcessingInstruction(L”xml”, L”version=’1.0′ encoding=’utf-8′ “);
pDoc->appendChild(pi);
MSXML::IXMLDOMCommentPtr pc = pDoc->createComment(L”SVG 出力テスト”);
pDoc->appendChild(pc);
{
MSXML::IXMLDOMElementPtr    pRoot = NULL ;
pRoot = pDoc->createElement(L”svg:svg”);
{    //    <svg width =’50%’ height=’50%’ viewBox=’0 0 100 100′ xmlns=”http://www.w3.org/2000/svg”>
MSXML::IXMLDOMAttributePtr    paw = pDoc->createAttribute(L”width”);
paw->value = L”50%”;
pRoot->setAttributeNode(paw);
MSXML::IXMLDOMAttributePtr    pah = pDoc->createAttribute(L”height”);
pah->value = L”50%”;
pRoot->setAttributeNode(pah);
MSXML::IXMLDOMAttributePtr    pav = pDoc->createAttribute(L”viewBox”);
pav->value = L”0 0 100 100″;
pRoot->setAttributeNode(pav);
MSXML::IXMLDOMAttributePtr    pan = pDoc->createAttribute(L”xmlns:svg”);
pan->value = _T(“http://www.w3.org/2000/svg”) ;
pRoot->setAttributeNode(pan);
}
pDoc->appendChild(pRoot);
{    //    <g stroke=’red’ stroke-width=’0.3′ stroke-dasharray=’3 3′>
MSXML::IXMLDOMElementPtr pGrop= pDoc->createElement(_T(“svg:g”));
{
MSXML::IXMLDOMAttributePtr    pas = pDoc->createAttribute(L”stroke”);
pas->value = _T(“red”) ;
pGrop->setAttributeNode(pas);
MSXML::IXMLDOMAttributePtr    paw = pDoc->createAttribute(L”stroke-width”);
paw->value = _T(“0.3″) ;
pGrop->setAttributeNode(paw);
MSXML::IXMLDOMAttributePtr    pad = pDoc->createAttribute(L”stroke-dasharray”);
pad->value = _T(“3 3″) ;
pGrop->setAttributeNode(pad);
}
pRoot->appendChild(pGrop) ;
{
for (int index=0 ; index<5 ; index++) {
//    <line  x1=”10″*x x2=”10″*x y1=”0″ y2=”100″ />
MSXML::IXMLDOMElementPtr pLine= pDoc->createElement(L”svg:line”);
{
CString    xStr ;        xStr.Format(_T(“%d”),10*index) ;
MSXML::IXMLDOMAttributePtr    pax = pDoc->createAttribute(L”x1″);
pax->value = LPCTSTR(xStr) ;
pLine->setAttributeNode(pax);
MSXML::IXMLDOMAttributePtr    pa2 = pDoc->createAttribute(L”x2″);
pa2->value = LPCTSTR(xStr) ;
pLine->setAttributeNode(pa2);
MSXML::IXMLDOMAttributePtr    pay = pDoc->createAttribute(L”y1″);
pay->value = _T(“10″) ;
pLine->setAttributeNode(pay);
MSXML::IXMLDOMAttributePtr    pae = pDoc->createAttribute(L”y2”);
pae->value = _T(“90”) ;
pLine->setAttributeNode(pae);
}
pGrop->appendChild(pLine) ;
}
}
}
}
CString    tmpPath ;
{
UINT    size = MAX_PATH ;
::GetTempPath    (size,tmpPath.GetBuffer(size)) ;
tmpPath.ReleaseBuffer() ;
}
CString    tmpSVG = tmpPath + CTime::GetCurrentTime().Format(_T(“%H%M%S.svg”)) ;
pDoc->save(LPCTSTR(tmpSVG)) ;
}
::CoUninitialize() ;
return    TRUE ;
}

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

XML の書出しテスト – 3

msxml.dll を利用して,点線の line を 5 本出力.
空の xmlns 属性が出来てしまうため,そのままでは表示されない.

<?xml version="1.0" encoding="utf-8" ?>
<!--SVG 出力テスト-->
<svg width="50%" height="50%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <g xmlns="" stroke="red" stroke-width="0.3" stroke-dasharray="3 3">
        <line x1="0" x2="0" y1="10" y2="90" />
        <line x1="10" x2="10" y1="10" y2="90" />
        <line x1="20" x2="20" y1="10" y2="90" />
        <line x1="30" x2="30" y1="10" y2="90" />
        <line x1="40" x2="40" y1="10" y2="90" />
        </g>
    </svg>

xmlns="" の部分を削除すると表示可能.

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

XML の書出しテスト – 2

loadXML の部分を改良.

// pDoc->loadXML(_T(""< ?xml version=\"1.0\" encoding=\"utf-8\"?>"< r>"< /r>")) ;
// Source: dynamDOMsmart.cpp より
 MSXML::IXMLDOMProcessingInstructionPtr pi =
  pDoc->createProcessingInstruction(L"xml", L"version='1.0'  encoding='utf-8' ");
  pDoc->appendChild(pi);
// Create a comment for the document.
 MSXML::IXMLDOMCommentPtr pc =
  pDoc->createComment(L"sample xml file created using XML DOM object.");
  pDoc->appendChild(pc);
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

XML の書出しテスト

XML に書き出すコードをテスト (VC6 + MFC で動作するもの)
他の言語や VC 9 などの場合は How Do I Use DOM? にある.


pDoc.CreateInstance で,結果が
  0x800401f0 CoInitialize は呼び出されていません。

xml のファイルは出来るが,中身がなし.
  pDoc->loadXML(…) で,デバッグの出力に以下が 3 つ.
  例外処理 (初回) は T_xml_1.exe (KERNEL32.DLL) にあります: 0xE0000001: (名前がありません)。
  ここで手間取ったので,…
    loadXML で与える文字列が,XML の文字列として正しくなかったのが原因.



// 以下は,そのテストコード全体
// T_xml_1.cpp : コンソール アプリケーション用のエントリ ポイントの定義
// 
#include	"StdAfx.h"
#include	"T_xml_1.h"
#import	named_guids	
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

BOOL	TestXML	(void)
{
	HRESULT	hr = ::CoInitialize(NULL) ;
	if (FAILED(hr))			{	return	FALSE ;		}
	{
		MSXML::IXMLDOMDocumentPtr	pDoc = NULL ;
		hr = pDoc.CreateInstance(MSXML::CLSID_DOMDocument) ;
		if (FAILED(hr))		{	return	FALSE ;		}
		pDoc->loadXML(_T("<?xml version=\"1.0\" encoding=\"utf-8\"?> <r> </r> ")) ;
		CString	tmpPath ;
		{
			UINT	size = MAX_PATH ;
			::GetTempPath	(size,tmpPath.GetBuffer(size)) ;
			tmpPath.ReleaseBuffer() ;
			}
		CString	tmpXML = tmpPath + CTime::GetCurrentTime().Format(_T("%H%M%S.xml")) ;
		pDoc->save(LPCTSTR(tmpXML)) ;
		}
	::CoUninitialize() ;
	return	TRUE ;
	}

/////////////////////////////////////////////////////////////////////////////
// 唯一のアプリケーション オブジェクト
CWinApp theApp;

using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;
	// MFC の初期化および初期化失敗時のエラーの出力
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))	{
		// TODO: 必要に応じてエラー コードを変更してください。
		cerr << _T("Fatal Error: MFC initialization failed") << endl;
		nRetCode = 1;
	}
	else	{
		/*
		// TODO: この位置にアプリケーションの動作を記述してください。
		CString strHello;
		strHello.LoadString(IDS_HELLO);
		cout << (LPCTSTR)strHello << endl;
		*/
		TestXML() ;
	}
	return nRetCode;
}

https://mish.work/joomla/index.php/cpp/xml.html

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

Windows Mobile 配置 0x8973190e

エミュレータや実機にコピーのタイミングで,以下のエラー

—— 配置開始: プロジェクト: Test, 構成: Debug Any CPU ——
次のエラーにより配置または登録に失敗しました: 0x8973190e. ファイル ‘%CSIDL_PROGRAM_FILES%\Test\Test.exe’ の書き込み中にエラーが発生しました。エラー 0x80070020: プロセスはファイルにアクセスできません。別のプロセスが使用中です。
========== ビルド: 1 正常終了、0 失敗、0 更新不要、0 スキップ ==========
========== 配置: 0 正常終了、1 失敗、0 スキップ ==========

それぞれのエクスプローラで,対象の exe を削除して対応.

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

DocTh.exe 2011.01.18 0xc0000374

Win7 環境のイベントビューアを見ていたら,エラーがいっぱい.

障害が発生しているアプリケーション名: DocTh.exe、バージョン: 1.10.2012.120、タイム スタンプ: 0x4f16d6f9
障害が発生しているモジュール名: ntdll.dll、バージョン: 6.1.7601.17725、タイム スタンプ: 0x4ec49b8f
例外コード: 0xc0000374
障害オフセット: 0x000ce6c3
障害が発生しているプロセス ID: 0x21cc
障害が発生しているアプリケーションの開始時刻: 0x01ccd71a3cef9b75
障害が発生しているアプリケーション パス: C:\Users\Iwao\AppData\Local\Temp\…\Project\DocTh\Release.060\DocTh.exe
障害が発生しているモジュール パス: C:\Windows\SysWOW64\ntdll.dll
レポート ID: 8e3b520d-430d-11e1-8bec-00219b51e933


AP 終了時に発生しているが,Win7 環境では,特に何も表示されない.
単純に exe を起動して,何もせず終了してもエラーが記録される.
同じ操作を,開発環境の XP で実行してもエラーにはならない.
また,デバッグ版 exe も問題ない.
他にもいろいろやったが,省略.
WinXP で,ドキュメントをドロップして終了でエラーが発生.

結局,原因は VC 6 でのビルド時の依存関係と思われるが,リビルドで解決.


この exe ではあまり意味はないが,Profile::SetPathINI() を利用しているので,これが原因かと思った.
  BOOL Profile::SetPathINI (void)
  {
    CWinApp* app = AfxGetApp() ;
    if (app == NULL) { return FALSE ; }
    CString nowINI = app->m_pszProfileName ;
    if (nowINI.Find(_T(“\\”)) > 0) {
      nowINI = GetFileName(nowINI) ;
      }
    CString newINI = Profile::CheckAndChangeINI(nowINI) ;
    free((void*)app->m_pszProfileName) ;
    app->m_pszProfileName = _tcsdup(newINI) ;
    return TRUE ;
    }
CWinApp::m_pszProfileName


i_Tools

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

HBITMAP から画像サイズ取得

昨日,クリップボードからの取得で画像サイズを求める方法がわからなかった.

  HBITMAP	hbm = (HBITMAP)::GetClipboardData(CF_BITMAP) ;
  if (hbm != NULL) {
    CSize	bmpSize(10,10) ;
    {
      BITMAP		bm ;
      ::ZeroMemory(&bm,sizeof(BITMAP)) ;
      if (::GetObject(hbm, sizeof(BITMAP),&bm)!=0) {
        bmpSize.cx = bm.bmWidth ;
        bmpSize.cy = bm.bmHeight;
        }
      }
    ...
    }

CBitmap で保持している場合は,

  CBitmap	bitmap ;
  if (bitmap.LoadBitmap(bmp_ID)) {
    BITMAP	bm ;
    bitmap.GetBitmap(&bm) ;
    CRect		rect = CRect(0,0,bm.bmWidth,bm.bmHeight) ;
    ...
    }

HENHMETAFILE では,

  HENHMETAFILE	hemf = (HENHMETAFILE)::GetClipboardData(CF_ENHMETAFILE) ;
  if (hemf !=NULL) {
    ENHMETAHEADER	emh ;
    ZeroMemory(&emh,sizeof(ENHMETAHEADER)) ;
    emh.nSize = sizeof(ENHMETAHEADER) ;
    if (::GetEnhMetaFileHeader(hemf,sizeof(emh),&emh) != 0) {
      CRect	rectB ;
      rectB.top	= emh.rclBounds.top ;
      rectB.left	= emh.rclBounds.left ;
      rectB.right	= emh.rclBounds.right ;
      rectB.bottom= emh.rclBounds.bottom ;
      CRect	rectF ;
      rectF.top	= emh.rclFrame .top ;
      rectF.left	= emh.rclFrame .left ;
      rectF.right	= emh.rclFrame .right ;
      rectF.bottom= emh.rclFrame .bottom ;
      }
    }

HBITMAP から画像サイズの取得

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

Clipboard Viewer

MSDN 2001.10 Creating a Clipboard Viewer Window
mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2001OCT\1041\ipc.chm::/hh/winbase/clipbrd_19dj.htm

MSDN Using the Clipboard

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

::StretchDIBits の戻り値が 0

ImageConverter::Stretch で ::StretchDIBits がうまく動作しない.
通常のダイアログとしての動作の時は問題なさそうだが,サイレントモードの場合 0 になる.
 memDC->FillSolidRect(-1,-1,rect.Width()+2,rect.Height()+2,0x00ffffff) ; などは OK.
うまくいかない(0 になる)場合,ImageConverter::ResizeAB を利用(Image::Stretch)することにより対応.

これを調べていた時に,MemoryDC::Init で ::CreateDIBSection の呼び出しがうまくない?ことを見つけた.
戻り値や ppvBits はそれなりに入っているが,GetLastError では,8 が戻される.
0x00000008 ERROR_NOT_ENOUGH_MEMORY このコマンドを実行するのに十分な記憶域がありません。

詳しく調べてないが,以前 StretchDIBits などでうまくなかったのは,ここら辺が影響していたのかも知れない.

ImgCnvrt.hxx

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.

ダイアログ.exe サイレントモード

ダイアログベースで,コマンドライン引数により何も表示しないで終了する exe


次の様なコードで,AfxWinMain でエラーになってしまう.
BOOL CReszPicApp::InitInstance()
{
  …
  CReszPicDlg dlg;
  m_pMainWnd = &dlg;
  if (_tcslen(m_lpCmdLine) != 0) {
    dlg.EnumDIB() ;
    dlg.ResizeDIB() ;
    return FALSE ;
    }
  INT_PTR nResponse = dlg.DoModal();
  …
  }


—————————
Microsoft Visual C++
—————————
ハンドルされていない例外 は ReszPic.exe (MFC42D.DLL) にあります: 0xC0000005: Access Violation。
—————————
OK
—————————


WinMain.cpp
int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
  …
  // Perform specific initializations
  if (!pThread->InitInstance()) {
    if (pThread->m_pMainWnd != NULL) {
      TRACE0(“Warning: Destroying non-NULL m_pMainWnd\n”);
      pThread->m_pMainWnd->DestroyWindow();
      }
    nReturnCode = pThread->ExitInstance();
    goto InitFailure;
    }
  …
  }


m_pMainWnd への設定より前に,サイレントモードでの動作を行えば良い.
  CReszPicDlg dlg;
  // m_pMainWnd = &dlg;
  if (_tcslen(m_lpCmdLine) != 0) {
    dlg.EnumDIB() ;
    dlg.ResizeDIB() ;
    return FALSE ;
    }
  m_pMainWnd = &dlg;
  INT_PTR nResponse = dlg.DoModal();


Message クラスなどで,AfxGetMainWnd()->GetSafeHwnd()==NULL の時の判断が抜けていたので修正.
AfxGetMainWnd()==NULL は多くの所で対応しているが,
AfxGetMainWnd()->GetSafeHwnd()==NULL は抜けがかなりありそう.

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.

CView の OnFilePrint を抜き出し

OnFilePrint の関係を DH_Print クラスとして抜き出しました.
ダイアログベースの exe や,ビューの表示対象と異なるオブジェクトの印刷などに利用できると思います.
利用方法はこんな感じ.

class	PrintTest	:	public	DH_Print	{
public:
  virtual	void	OnPrint	  (CDC* pDC,	CPrintInfo* pInfo)	{
    CRect	rect = pInfo->m_rectDraw ;
    {
      pDC->TextOut(0,0,_T("ここが印刷のためのコードです.")) ;
      }
    return	;
    }
  virtual	BOOL	OnPreparePrinting (	CPrintInfo* pInfo)	{
    pInfo->SetMaxPage(5) ;
    return	DoPreparePrinting(pInfo) ;
    }
  virtual	CString	GetDocumentTitle  (void)	{
    return	_T("通常はドキュメント名を戻します.") ;
    }
  } ;

印刷が押されると,

void CAboutDlg::OnPrint() 
{
  PrintTest	pt ;
  if (pt.OnFilePrint()) {
    OnOK() ;
    }
  }

Print.zip
Print
マルチページ ドキュメント


2020/07/13 Google ドライブ上の Print.zip へのリンク
Print.zip


2020/12/17 公開しているファイルだけでは利用できなかったので修正
Print_2020_12.zip
クラス名 Print は DH_Print に変更.
印刷時のデフォルトのドキュメント名を ” DH_Print : %Y/%m/%d %H:%M:%S ” に変更.


DH_Print クラスを利用したサンプル.
DH_Print クラスのサンプル EMF の印刷
PrtMF_2020_12.zip
DH_Print 利用のソースが zip の中にあり.

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

Virtual PC が遅い-その後

再起動を試したが,効果なし.
サーバのウィルス対策ソフトをアンインストールしたが,これも効果なし.

サーバからクライアントのファイルなどを参照する場合は以前と変わらないと思われる.
クライアント間も特に問題なし.
イベントビューアなどで,関連しそうなログは見つからない.

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

DDV を働かせたい

あまり DDV は使用しないが,数値で簡単な範囲チェックをやりたかった.
最大文字数などは指定しておけば勝手にやってくれるが,値のチェックはそうではない.

適当な(チェックしたい)タイミングで UpdateData(TRUE) を呼んでやればよい.
例えば,
void CXxxxDlg::OnChangeXxx() { UpdateData(TRUE) ; }
EN_UPDATE とどちらが良いかは不明.

本当は範囲を超えた時の入力をはじきたいが,それは簡単にはできなかった.

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

Virtual PC が遅い

昨日から Virtual PC と,ホスト間のアクセスが極端に遅くなった.
今までも,たまに,ファイルコピーなどで一時的に遅くなったことはあったが,ここまでではなかった様な...
エクスプローラで,左のフォルダツリーが表示されているとこれも遅い.
他の Virtual PC の共有フォルダの参照は,そこまでではないように感じるが...

動作は,電源 OFF などで LAN 上からいなくなった PC を参照した様な感じ.

全ての Virtual PC の終了で,今までは普通に戻っていたが今回は違うみたい.

ルータなども含め,LAN 上の全ての再起動が必要か?
それともホストにウィルス対策ソフト 2012 の体験版をインストールした影響か?

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

UNICODE

UNICODE 文字関係へのリンク


リコー ホーム > フォント > 過去のメルマガ > 
   第7号 JIS第3・第4水準
   その中の 実際の文字種–>PDF
    JIS第3水準漢字
    JIS第3水準非漢字
    JIS第4水準漢字
 
CodeZine
   サロゲートペア入門
 
Microsoft JIS X 0213:2004 / Unicode 実装ガイド (PDF)
 
図書館員のコンピュータ基礎講座
   文字コード
      日本の文字コード
         
   参考資料 > 文字コード
 
IME 2010 S-JIS

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