WPF WPFApp Xaml Application x ClassWindows Application 1

  • Slides: 62
Download presentation

WPFアプリの場合 WPFアプリのエントリポイントはApp. Xamlの <Application x: Class="Windows. Application 1. App" xmlns="http: //schemas. microsoft. com/winfx/2006/xaml/pr esentation"

WPFアプリの場合 WPFアプリのエントリポイントはApp. Xamlの <Application x: Class="Windows. Application 1. App" xmlns="http: //schemas. microsoft. com/winfx/2006/xaml/pr esentation" xmlns: x="http: //schemas. microsoft. com/winfx/2006/xaml" Startup. Uri="Window 1. xaml" > </Application> わんくま同盟 東京勉強会 #6

WPFアプリの場合 WPF + Windows Forms混在アプリを作る場合には Appクラスのコンストラクタで、Enable. Visual. Stylesする。 public partial class App : System.

WPFアプリの場合 WPF + Windows Forms混在アプリを作る場合には Appクラスのコンストラクタで、Enable. Visual. Stylesする。 public partial class App : System. Windows. Application { public App() { System. Windows. Forms. ⇒ Application. Enable. Visual. Styles(); } } わんくま同盟 東京勉強会 #6

Command Link Button 実現するにはボタンを継承したコントロールで、Create. Params を上書きしちゃいます。 const int BS_COMMANDLINK = 0 x 0000000 E;

Command Link Button 実現するにはボタンを継承したコントロールで、Create. Params を上書きしちゃいます。 const int BS_COMMANDLINK = 0 x 0000000 E; protected override Create. Params { get { if (System. Environment. OSVersion. Major >= 6) { Create. Params c. Params = base. Create. Params; c. Params. Style |= BS_COMMANDLINK; return c. Params; } else { return base. Create. Params; } }} わんくま同盟 東京勉強会 #6

Command Link Button さらにNote部という部分が増えています。 これにはメッセージです。 const int BCM_SETNOTE = 0 x 1609; Send. Message(new

Command Link Button さらにNote部という部分が増えています。 これにはメッセージです。 const int BCM_SETNOTE = 0 x 1609; Send. Message(new Handle. Ref(this, this. Handle), BCM_SETNOTE, Int. Ptr. Zero, value); Getは面倒なので割愛 わんくま同盟 東京勉強会 #6

使うためには • Windows SDK 6. 1をインストール http: //www. microsoft. com/downloads/details. aspx? Family. ID=ff 6467

使うためには • Windows SDK 6. 1をインストール http: //www. microsoft. com/downloads/details. aspx? Family. ID=ff 6467 e 6 -5 bba-4 bf 5 b 562 -9199 be 864 d 29&Display. Lang=en • プロジェクトメニュー→プロパティ→構成 プロパティ→C/C++→全般→追加のイ ンクルードディレクトリにSDKのInclude フォルダを追加 • #define設定 – #define WINVER 0 x 0600 – #define _WIN 32_WINNT 0 x 0600 わんくま同盟 東京勉強会 #6

ミニマムコード(ATL版) : : Co. Initialize(NULL); CCom. Ptr<IFile. Open. Dialog> ifd; ifd. Co. Create. Instance(__uuidof(File.

ミニマムコード(ATL版) : : Co. Initialize(NULL); CCom. Ptr<IFile. Open. Dialog> ifd; ifd. Co. Create. Instance(__uuidof(File. Ope n. Dialog)); ifd->Show(NULL); : : Co. Uninitialize(); #もちろん開くだけ わんくま同盟 東京勉強会 #6

ログを取る場合の問題点 • http: //blogs. wankuma. com/naka/archive/2007/03/15/66950. aspx • http: //blogs. wankuma. com/naka/archive/2007/03/16/67146. aspx •

ログを取る場合の問題点 • http: //blogs. wankuma. com/naka/archive/2007/03/15/66950. aspx • http: //blogs. wankuma. com/naka/archive/2007/03/16/67146. aspx • http: //blogs. wankuma. com/naka/archive/2007/03/19/67563. aspx • http: //blogs. wankuma. com/naka/archive/2007/03/27/69201. aspx • http: //blogs. wankuma. com/naka/archive/2007/03/28/69340. aspx こっそりあおり連載でした。 • • • 時系列に取れない(Mixされる) 遅い 大きい 排他待ち バラバラ わんくま同盟 東京勉強会 #6

CLFSの使い方 1 開く using (Log. Record. Sequence sequence = new Log. Record. Sequence( LOG_PATH,

CLFSの使い方 1 開く using (Log. Record. Sequence sequence = new Log. Record. Sequence( LOG_PATH, System. IO. File. Mode. Open. Or. Create, System. IO. File. Access. Read. Write, File. Share. Read. Write)) ポイント File. Share. Read. Writeで開く!!でないと排他がかかっちゃうよ わんくま同盟 東京勉強会 #6

CLFSの使い方 2 初回だけポリシー設定を if (sequence. Log. Store. Extents. Count == 0) { sequence. Log.

CLFSの使い方 2 初回だけポリシー設定を if (sequence. Log. Store. Extents. Count == 0) { sequence. Log. Store. Policy. Auto. Grow = true; sequence. Log. Store. Policy. Growth. Rate = new Policy. Unit(1, Policy. Unit. Type. Extents); sequence. Log. Store. Policy. Commit(); sequence. Log. Store. Policy. Refresh(); ポイント CommitとRefreshを実行する。 ほかにもファイルプレフィックス、サフィックスなどを設定する。 組み合わせで動かない場合もあるので、テストしましょう。 わんくま同盟 東京勉強会 #6

CLFSの使い方 4 ログ出力 sequence. Append( segment, Sequence. Number. Invalid, Record. Append. Options. None); ポイント

CLFSの使い方 4 ログ出力 sequence. Append( segment, Sequence. Number. Invalid, Record. Append. Options. None); ポイント Record. Append. OptionsはNoneにすること。 でないとパフォーマンスはでない わんくま同盟 東京勉強会 #6

XPSはどうやったら使えるの? • 作る方 – Windows Vista – 2007 Office Systems+保存アドイン –. NET Framework 3.

XPSはどうやったら使えるの? • 作る方 – Windows Vista – 2007 Office Systems+保存アドイン –. NET Framework 3. 0 • 見る方 – Windows Vista – Windows XP or Windows Server 2003 & XPS Essentials Pack + MSXML 6. 0 わんくま同盟 東京勉強会 #6

ページ情報はどうなっているの?(抜粋) • <Fixed. Page Width="793. 76" Height="1122. 56" xmlns="http: //schemas. microsoft. com/xps/2005/06"ページ情報 xml: lang="und">

ページ情報はどうなっているの?(抜粋) • <Fixed. Page Width="793. 76" Height="1122. 56" xmlns="http: //schemas. microsoft. com/xps/2005/06"ページ情報 xml: lang="und"> • <Path Data="F 1 M 75. 52, 75. 52 L 165. 28, 75. 52 165. 28, 86. 08 75. 52, 86. 08 z" Fill="#ffff" />ブラシ • <Glyphs Fill="#ff 000000" 文字 Font. Uri="/Documents/1/Resources/Fonts/1 ED 08800 -1 D 11 -4 DEE-9484 -91 F 85 C 6 F 520 A. odttf" フォント Font. Rendering. Em. Size="10. 5604" 指定 Style. Simulations="None" Origin. X="75. 52" サイズ、 Origin. Y="84. 64" 位置 Indices="2102; 2104; 2106; 2108; 2110; 59; 51; 54; 11 764; 11754" Unicode. String="あいうえおXPS薔薇" /> • </Fixed. Page> 文字列 わんくま同盟 東京勉強会 #6

それではXPSを作ってみましょう。 関連する名前空間は System. Windows. Xps. Packaging. Xps. Serialization System. Printing わんくま同盟 東京勉強会 #6

それではXPSを作ってみましょう。 関連する名前空間は System. Windows. Xps. Packaging. Xps. Serialization System. Printing わんくま同盟 東京勉強会 #6

参考文献 ★Command. LinkとSETNOTEとシールドアイコン knom's developer corner(en) http: //blogs. msdn. com/knom/archive/2007/03/12/command_5 F 00_link. a spx

参考文献 ★Command. LinkとSETNOTEとシールドアイコン knom's developer corner(en) http: //blogs. msdn. com/knom/archive/2007/03/12/command_5 F 00_link. a spx Windows. SDKの位置 Win 32 and COM Development→User Interface →Windows Controls →Individual Control Information →Button Controls わんくま同盟 東京勉強会 #6

参考文献 ★IFile. Dialogについて Windows Vista for Developers – Part 6 – The New File

参考文献 ★IFile. Dialogについて Windows Vista for Developers – Part 6 – The New File Dialogs(en) http: //weblogs. asp. net/kennykerr/archive/2006/11/10/Windows-Vista-for -Developers-_1320_-Part-6 -_1320_-The-New-File-Dialogs. aspx Kkamegawaさんのcodeseekでの発表資料(ja) http: //mist. clueup. org/files/default. aspx Windows. SDKの位置 Win 32 and COM Development→User Interface →Windows Shell→Shell Reference→Shell Interfaces →IFile. Dialog わんくま同盟 東京勉強会 #6

参考文献 ★System. IO. Log(CLFS)について Fast and Flexible Logging with Vista's Common Log File System(en)

参考文献 ★System. IO. Log(CLFS)について Fast and Flexible Logging with Vista's Common Log File System(en) http: //www. devx. com/Vista. Special. Report/Article/33848/0/page/1 Windows Server 2003 R 2 の新機能 http: //technet 2. microsoft. com/Windows. Server/ja/Library/f 9 d 70026 -ae 8 b -4969 -8755 -1 ea 1 edc 4 e 38 e 1041. mspx? mfr=true Windows SDKの位置 Win 32 and COM Development →System Services→File Systems→Common Log File System. NET Framework Development→. NET Framework Technologies→Core Development Technologies→Logging Support in System. IO. Log わんくま同盟 東京勉強会 #6

参考文献 ★XPSについて 1 Printing Overview mshelp: //MS. MSSDK. 1033/MS. NETFX 30 SDK. 1033/wpf_conceptual/ht ml/0

参考文献 ★XPSについて 1 Printing Overview mshelp: //MS. MSSDK. 1033/MS. NETFX 30 SDK. 1033/wpf_conceptual/ht ml/0 de 8 ac 41 -9 aa 6 -413 d-a 121 -7 aa 6 f 41539 b 1. htm 2007 Microsoft Office プログラム用 Microsoft PDF/XPS 保存アドイン http: //www. microsoft. com/downloads/details. aspx? Family. ID=4 d 9519113 e 7 e-4 ae 6 -b 059 -a 2 e 79 ed 87041&Display. Lang=ja Microsoft XML Paper Specification Essentials Pack Version 1. 0 http: //www. microsoft. com/downloads/details. aspx? Family. Id=B 8 DCFFD D-E 3 A 5 -44 CC-8021 -7649 FD 37 FFEE&displaylang=en Microsoft Core XML Services (MSXML) 6. 0 http: //www. microsoft. com/downloads/details. aspx? displaylang=ja&Fami ly. ID=993 c 0 bcf-3 bcf-4009 -be 21 -27 e 85 e 1857 b 1 わんくま同盟 東京勉強会 #6

参考文献 ★XPSについて 2 Windows Hardware. Developer Central http: //www. microsoft. com/whdc/xps/default. mspx XPS for

参考文献 ★XPSについて 2 Windows Hardware. Developer Central http: //www. microsoft. com/whdc/xps/default. mspx XPS for Application Developers http: //www. microsoft. com/whdc/xpsappdevs. mspx XML Paper Specification (Spec) http: //www. microsoft. com/whdc/xpsspec. mspx XPS Team Blog http: //blogs. msdn. com/xps/ Feng Yuan (袁峰) http: //blogs. msdn. com/fyuan/ わんくま同盟 東京勉強会 #6

参考文献 ★XPSについて 3 Optimize XPS markup(パフォーマンスの注意点) http: //blogs. msdn. com/fyuan/archive/2006/01/18/514450. aspx Query regarding Create.

参考文献 ★XPSについて 3 Optimize XPS markup(パフォーマンスの注意点) http: //blogs. msdn. com/fyuan/archive/2006/01/18/514450. aspx Query regarding Create. Font. Package API used for Font Subsetting http: //forums. microsoft. com/MSDN/Show. Post. aspx? Post. ID=222335&Si te. ID=1 Insertion of an adendum to the intro to font embedding http: //blogs. msdn. com/michkap/archive/2006/08/02/686538. aspx Creating an XPS Document Sample mshelp: //MS. MSSDK. 1033/MS. NETFX 30 SDK. 1033/wpf_samples/html/ a 7736471 -4322 -40 ea-8580 -34 c 8 eb 0 dbb 3 e. htm わんくま同盟 東京勉強会 #6