2007/07/02 Windows Mobil 6 のサンプルの説明

[Windows Mobile 6] サンプルの説明の訳

こういうのって、html にしてるんだから
どこかにアップすればいいのに。
さらに言うなら、マイクロソフトに日本語化スタッフくらい居るでしょ?
なんで日本語で用意しないのさ。

大手で現地語訳を用意しない製品って
本当にシェア伸ばす気があんのかって思う。

そのうち怒られたら消す。
Windows Mobile 6 SDK リフレッシュ - サンプル
(訳注:リフレッシュってなに?)
Windows Mobile の SDK には100以上のサンプルがついている。
実際に動いて、Windows Mobile プラットフォーム上のソフトウェアを作り方を勉強するのにぴったりなやつが。
Professional SDK と Standard SDK をインストールしたときに、一緒に入ってくる。
どちらのSDKでもうごく共通のサンプルと、プラットフォーム固有のサンプルがある。
デフォルトでは、 Professional SDK のサンプルは
C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\
Standard SDK のサンプルは
C:\Program Files\Windows Mobile 6 SDK\Samples\Smartphone\
そして、共通のサンプルは
C:\Program Files\Windows Mobile 6 SDK\Samples\Common\
にある

ほとんどのサンプルが C++ で書かれた、Win32 アプリケーションで
CPPフォルダにコードが入っている

サンプルを使うには、*.sln ファイルをクリックして、Visual Studio 2005 を立ち上げるだけ。
これでビルドできるし、修正して再配布してもオーケー。

Windows Vista では、ちゃんと読み込み、書き込みを許可したフォルダで
サンプルを動かしてね。



■サンプル名
Sync Manager

■フォルダ名
\Common\CPP\Win32\SyncManager

■使用 API
ActiveSyncStart, ActiveSyncStop

■概要
Launches and terminates sync sessions. Displays the use of State and NotificationAPIs to register for changes to the two sync related Status Entries.
ActiveSyncの同期開始や、同期解除のサンプル。
現在の同期の状態も表示する。


■サンプル名
Camera Capture Graph

■フォルダ名
\PocketPC\CPP\win32\CameraCapture

■使用 API
ICaptureGraphBuilder2 Interface

■概要
Demonstrates the basic video capture functionalities using the native Camera APIs.Captures and encodes a video clip in WMV format. Captures and encodes a still imagein jpeg format.
低レベルなカメラ API を使って、ビデオ映像と静止画を撮影する。
ビデオ映像は WMV フォーマットへのエンコードを行い
静止画は jpeg フォーマットへのエンコードを行う


■サンプル名
Camera Capture

■フォルダ名
\Common\CPP\Win32\CECamera

■使用 API
SHCameraCapture,

■概要
Take pictures and videos using the native Camera Capture API.
低レベルなカメラキャプチャ API を使用して、画像とビデオを撮影する。


■サンプル名
Camera Capture

■フォルダ名
\Common\CS\CECamera

■使用 API
Microsoft.WindowsMobile.Forms.CameraCaptureDialog

■概要
Demonstrates how to take pictures and videos using the CameraCaptureDialog managedAPI.
CameraCaptureDialog API を使って
静止画とビデオを撮る方法を示す


■サンプル名
Telephone Dialer

■フォルダ名
\Common\CPP\Win32\CellCore\CeDialer

■使用 API
lineInitialize, lineNegotiateAPIVersion, lineGetDevCaps, lineDrop, lineDeallocateCall,lineClose.

■概要
Demonstrates how to dial a call with a modem using TAPI.
TAPIを使って、モデムを通した電話のかけ方を示す


■サンプル名
Synchronous TAPI

■フォルダ名
\Common\CPP\Win32\CellCore\ExTAPI

■使用 API
lineNegotiateAPIVersion, lineGetDevCaps, lineGetGeneralInfo, lineInitializeEx, lineOpen,lineClose, lineShutdown

■概要
Demonstrates ExTAPI functionality.
Extended TAPI を使った機能を示す


■サンプル名
Asychronous TAPI

■フォルダ名
\Common\CPP\Win32\CellCore\ExTAPIAsync

■使用 API
lineNegotiateAPIVersion, lineGetDevCaps, lineGetGeneralInfo, LINEINITIALIZEEXPARAMS,lineNegotiateExtVersion, lineGetOperatorStatus, lineOpen, lineClose, lineShutdown

■概要
Demonstrates ExTAPI asynchronous functionality.
Extended TAPI の非同期処理を示す


■サンプル名
Hello (SMS)

■フォルダ名
\Common\CPP\Win32\CellCore\SMS\HelloSMS

■使用 API
SmsSendMessage

■概要
Demonstrates simple SMS message Sender.
シンプルな SMS の送信を行う


■サンプル名
Hello (Telephone)

■フォルダ名
\Common\CPP\Win32\CellCore\TAPI\HelloTAPI

■使用 API
tapiRequestMakeCall

■概要
Demonstrates simple TAPI dialer.
シンプルなTAPIを用いた電話のかけかた(ダイアラ/ダイヤラ 機能)


■サンプル名
Sending Data over SMS

■フォルダ名
\Common\CPP\Win32\CellCore\WDP_SMS

■使用 API
WapOpen, WapSend, WapRead, WapClose

■概要
Demonstrates both sending and receiving data via the Wireless Datagram Protocol(WDP) over Short Messaging Service (SMS).
WDPプロトコルを使ったデータの送受信を、SMS の技術をつかって行う


■サンプル名
Bluetooth Device Discovery

■フォルダ名
\PocketPC\CPP\win32\Bluetooth\btsearch

■使用 API
Bluetooth, Implementing Synchronous Device Discovery, Winsock Support in WindowsCE, WSALookupServiceBegin (Windows Sockets), WSALookupServiceNext (Windows Sockets),WSALookupServiceEnd (Windows Sockets)

■概要
Provides an implementation of simple Bluetooth device discovery via the Winsock2 API.
シンプルなBluetooth機器の検出方法を、Winsock2 API を用いて示す


■サンプル名
Chatting over Bluetooth

■フォルダ名
\PocketPC\CPP\win32\Bluetooth\BthChat

■使用 API
Bluetooth , Implementing Asynchronous Device Discovery

■概要
Demonstrates how to create peer-to-peer communications between two devices usingBluetooth wireless technology.
Bluetooth の無線通信で、ピアツーピアなコネクションを確立する方法を示す


■サンプル名
Bluetooth Game

■フォルダ名
\Common\CS\Bluetooth\SpaceWar2D

■使用 API
System.Drawing,
Microsoft.WindowsMobile.SharedSource.Bluetooth

■概要
Demonstrates how to use the Windows Embedded Source Tools for Bluetooth Technology.
Windows Embedded Source Tools(訳注:?)を Bluetooth に大して用いる方法を示す


■サンプル名
Connection Manager Helper

■フォルダ名
\PocketPC\CPP\MFC\CMHELPER

■使用 API
ConnMgrEstablishConnection, ConnMgrConnectionStatus, ConnMgrReleaseConnection, ConnMgrMapURL,ConnMgrProviderMessage

■概要
Demonstrates how to write a simplified Connection Manager client by deriving functionality from a helper class.
ヘルパークラスを改造して、シンプルなコネクションマネージャクライアントの作り方を示す


■サンプル名
Time Server Synchronization

■フォルダ名
\Smartphone\CPP\Win32\CMTime

■使用 API
ConnMgrReleaseConnection, ConnMgrEnumDestinations, ConnMgrEstablishConnection

■概要
Demonstrates how to use Connection Manager to establish a connection to a Time Server, and synchronize the Smartphone's internalclock.
コネクションマネージャを実際に使って、タイムサーバと通信し、携帯電話の時刻を同期させる方法を示す


■サンプル名
WDP over SMS

■フォルダ名
\Common\CPP\Win32\CellCore\WDP_SMS

■使用 API
WapOpen, WapSend, WapRead, WapClose

■概要
Demonstrates how to send and receive data using the Wireless Datagram Protocol (WDP),over the Short Messaging Service (SMS) transport.


■サンプル名
WAP at WDP Layer

■フォルダ名
\Common\CPP\Win32\WDP

■使用 API
WapOpen, WapSend, WapRead, WapClose, WapGetNextPrimitiveSize

■概要
Demonstrates how to use the WAP APIs at the WDP Layer.
WDP 層での WAP 関連の API の使い方を示す。
参考までに
WAP=無線アプリケーション・プロトコル、無線の通信関係の規格の総称
WDP=WAP で応答確認しない通信 UDPみたいなもん
つまりこれは無線関係のサンプルだね


■サンプル名
Ringtone manager

■フォルダ名
\Common\CS\RingtoneManager

■使用 API
SndGetSoundDirectoriesList, SndPlaySync, SndPlayAsync, SndOpen, SndStop, SndClose,PInvoke

■概要
Scans the device for audio files and also lets you copy those files to a directorywhere they will be recognize as a ring tone file. It PInvokes SndPlayAsync in orderto preview the ringtones.
デバイスから音声ファイルを探して、着信音に設定する。着信音のプレビュウには SndPlayAsync を使う(音声に関してもプレビュウって言うんだね)

■サンプル名
WAP Provisioning Client

■フォルダ名
\Common\CPP\Win32\CfgClient

■使用 API
DMProcessConfigXML

■概要
Loads WAP provisioning XML from a string resource and passes it to DMProcessConfigXML.
provisioningがイマイチわからんなー。
多分 WAP について『規定』したXMLを文字列から読み込んで DMProcessConfigXML に渡すんじゃないか。
その結果どうなるかは知らん。


■サンプル名
Setup in a CAB

■フォルダ名
\Common\CPP\Win32\SetupDLL

■使用 API
Installation Functions Customizing the Setup Wizard and Property Sheets for a ThinClient, Debugging Setup, CreateProcess

■概要
Demonstrates a user-interactive sample of a setup.dll that can be included in CABfiles to perform complex operations.
これは要するにインストール時に DLL を叩いて、独自のインストーラ的な動作をするってこと。ユーザとの受け答えも可能。

■サンプル名
Viewing Security Settings

■フォルダ名
\Common\CS\SecurityViewer

■使用 API
ProcessConfiguration, TestConfiguration

■概要
Demonstrates how work with security policies and certificates.
セキュリティと、証明書に関する動作。

■サンプル名
Custom Authentication Reset Component

■フォルダ名
\PocketPC\CPP\win32\AuthReset

■使用 API
ARCSetup, ARCRequest, ARCGetValue

■概要
Demonstrates how to create a custom Authentication Reset Component (ARC).
これはよく分からない。名前だけは聞いたような…認証リセットコンポーネント。上のサンプルとセットかなあ。

■サンプル名
LAP Plug-in for Pocket PC

■フォルダ名
\PocketPC\CPP\win32\LAP

■使用 API
InitLAP, DeinitLAP, VerifyUser, VerifyUserStart, VerifyUserStop
VerifyUserToTop, LAPCreateEnrollmentConfigDialog, LAPCancelVerifySequence, LAPDisplayCodeword,LAPDisplayPreWipe, LAPLockoutUser, LASSGetValue

■概要
Implements a LAP plug-in, including all optional LAP APIs.
LAPわからんです。後でしらべる

■サンプル名
LAP Plug-in for Smartphone

■フォルダ名
\Smartphone\CPP\win32\LAP

■使用 API
InitLAP, DeinitLAP, VerifyUser, VerifyUserStart, VerifyUserStop
VerifyUserToTop, LAPCreateEnrollmentConfigDialog, LAPCancelVerifySequence, LAPDisplayCodeword,LAPDisplayPreWipe, LAPLockoutUser, LASSGetValue

■概要
Implements a LAP plug-in, including all optional LAP APIs.


■サンプル名
D3D Create Device

■フォルダ名

\PocketPC\CPP\win32\Directx\d3dm\tutorials\tut01_createdevice

■使用 API
Direct3D Mobile Application Development

■概要
Creates a Direct3D device and uses it to clear the window.
Direct3D を知らない人に説明すると、DirectX という Microsoft のグラフィック、サウンド、インプット(要するにメディア全般)ライブラリの、3D グラフィックスに相当するもの。 携帯から使えるんだねー。

■サンプル名
D3D Vertices

■フォルダ名

\PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut02_vertices

■使用 API
Direct3D Mobile Application Development, IDirect3DMobileDevice::CreateVertexBuffer

■概要
Demonstrates the way vertices are transformed (meaning they are already in 2D windowcoordinates) and lit (meaning we are not using Direct3D Mobile lighting, but aresupplying our own colors).


■サンプル名
D3D Matrices

■フォルダ名

\PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut03_matrices

■使用 API
Direct3D Mobile Application Development, IDirect3DMobileDevice::SetTransform

■概要
Demonstrates the use of 4x4 matrices to transform the geometry with translations,rotations, scaling, and setting up our camera.


■サンプル名
D3D Dynamic Lighting

■フォルダ名

\PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut04_lights

■使用 API
Direct3D Mobile Application Development, D3DMLIGHT, D3DM_SETLIGHT, IDirect3DMobileDevice::LightEnable

■概要
Demonstrates how to render 3D geometry with dynamic lighting.


■サンプル名
D3D Texture Mapping

■フォルダ名

\PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut05_textures

■使用 API
Direct3D Mobile Application Development, IDirect3DMobileDevice::SetTexture, IDirect3DMobileDevice::SetTextureStageState

■概要
Demonstrates how to render texture-mapped 3D geometry.


■サンプル名
D3D Fixed Point Data

■フォルダ名

\PocketPC\CPP\win32\Directx\D3DM\tutorials\Tut06_fixedpoint

■使用 API
Direct3D Mobile Application Development

■概要
Demonstrates how to accept both floating point and fixed point (16.16) data types.


■サンプル名
DDraw Initialization

■フォルダ名

\PocketPC\CPP\win32\Directx\DDraw\DDex1

■使用 API
DirectDraw

■概要
Demonstrates how to initialize DirectDraw and create a DirectDraw surface.


■サンプル名
DDraw and Bitmaps

■フォルダ名

\PocketPC\CPP\win32\Directx\DDraw\Ddex2

■使用 API
DirectDraw

■概要
Demonstrates how to add a bitmap. Extends DDex1.


■サンプル名
DDraw Off-Screen Surfaces

■フォルダ名

\PocketPC\CPP\win32\Directx\DDraw\Ddex3

■使用 API
DirectDraw

■概要
Demonstrates the use of off-screen surfaces.


■サンプル名
DDraw and Audio

■フォルダ名

\PocketPC\CPP\win32\Directx\DDraw\Donuts2

■使用 API
DirectDraw

■概要
Demonstrates how to combine DirectDraw and waveform audio.


■サンプル名
DDraw and Animation

■フォルダ名

\PocketPC\CPP\win32\Directx\DDraw\Mosquito

■使用 API
DirectDraw

■概要
Demonstrates DirectDraw animation using overlays.


■サンプル名
UILayout

■フォルダ名
\PocketPC\CPP\win32\UILayout

■使用 API
ScreenLib - a class that makes it very easy to resize and stretch controls to maximizeusage of the available screen space.

■概要
Demonstrates a technique to achieve screen size and orientation independence inyour applications. Since Windows Mobile devices come in a variety of shapes andsizes, it is a good practice to stretch and shrink your dialog box controls dependingon screen size, which can even change at runtime.


■サンプル名
Crossword

■フォルダ名
\PocketPC\CPP\win32\Crossword

■使用 API
ChangeDisplaySettingsEx, WM_SETTINGCHANGE, WM_SIZE, GetDeviceCaps, GetSystemMetrics,SHGetUIMetrics

■概要
Demonstrates how to convert a basic application into a high DPI aware applicationand into a landscape/portrait aware application.


■サンプル名
Screen Resolution

■フォルダ名
\PocketPC\CPP\win32\Resdll

■使用 API
Developing DPI Aware Applications

■概要
As you are developing applications for new high-resolution Pocket PCs with 192 DPIresolution displays, you might wonder where the new high-resolution bitmaps andresources should go. The simplest solution is to include them in the same EXECUTABLEalongside the old, low-resolution resources. However, this approach wastes storagespace. Device screens only have one resolution, which never changes for that device.Therefore, if the application is deployed to a 96 DPI device, it doesn't need 192DPI resources - and vice versa.


■サンプル名
CEDB to EDB migration

■フォルダ名
\Common\CPP\Win32\FileDB

■使用 API
EDB/CEDB, CeOidGetInfoEx2, CeMountDBVol, CeCreateDatabaseWithProps,
CeCreateSession, CeOpenDatabaseInSession, CeSeekDatabaseEx

■概要
Demonstrates how an application that used CEDB can been ported to use EDB.


■サンプル名
DRM Files

■フォルダ名
\Common\CPP\Win32\FileDRM

■使用 API
FileDrmIsDRM, FileDrmShowLicenseInfo, FileDrmVerifyRights, FileDrmCreateFile, FileDrmGetMetric,FileDrmCommitRights

■概要
Demonstrates how to use the FileDRM APIs.


■サンプル名
Imaging Sample

■フォルダ名
\Common\CPP\Win32\Imaging

■使用 API
IImage, IImagingFactory

■概要
Demonstrates how to use the imaging.dll to load and display an image file.


■サンプル名
AXSample

■フォルダ名
\Common\CPP\ATL\AXSample

■使用 API
ActiveX Controls,ATL,COM

■概要
Demonstrates how to use ATL to create an ActiveX control, and how to access it in a web page.


■サンプル名
Web Browsing

■フォルダ名
\PocketPC\CPP\win32\browse

■使用 API
HTML Control API

■概要
Demonstrates the use of the HTML Viewer control, including the use of the DTM_NAVIGATEmessage to cause the control to download and display content from a URL.


■サンプル名
The Browser Helper Object (BHO)

■フォルダ名
\Common\CPP\ATL\PIEHelper

■使用 API
IWebBrowser2, DWebBrowserEvents2

■概要
Demonstrates now to create a Browser Helper Object (BHO), which Internet Explorer(IE) Mobile loads each time it starts up.


■サンプル名
Using Internet Explorer Mobile In Your Application

■フォルダ名
\Common\CPP\ATL\MiniPIE

■使用 API
IWebBrowser2, DWebBrowserEvents2

■概要
Demonstrates how to reuse the Internet Explorer Mobile web browser in a mobile application.


■サンプル名
AJAX

■フォルダ名
\Common\AJAX\

■使用 API
Ajax demonstration for Internet Explorer Mobile

■概要
This sample demonstrates how to use the Ajax-model of web page design in a way that is compatible with Internet Explorer Mobile.


■サンプル名
Medical History

■フォルダ名
\PocketPC\CPP\win32\MedicalHistory

■使用 API
IItem::SetProps, IPOutlookApp2::GetIDsFromNames, IPOutlookApp2 (, IPOutlookApp2::GetItemFromOidEx),IItem (, IItem::Save), Menu Extensibility, IContextMenu, IObjectWithSite

■概要
Demonstrates how to add a menu extension to the contacts summary card.


■サンプル名
Message Queuing

■フォルダ名
\Common\CPP\Win32\MSMQ\VisAdm

■使用 API
Using the MSMQAdm Utility, Debugging MSMQ Installations, MSMQ Reference

■概要
Demonstrates how to use message queuing (MSMQ). It is a visual wrapper around MSMQADM.exe.


■サンプル名
Push Messaging

■フォルダ名
\Common\CPP\Win32\FileClient

■使用 API
ShellExecuteEx

■概要
Demonstrates a push client that receives a push message and saves the message'sbody into a file and then calls ShellExecuteEx on that file.


■サンプル名
Set Message Store Properties

■フォルダ名
\PocketPC\CPP\win32\MailSet

■使用 API
IMAPISession, IMAPITable, IMAPIProp::GetProps, IMAPIProp::SetProps

■概要
Demonstrates how to use IMsgStore::GetProps and IMsgStore::SetProps how to retrieveand set properties on message stores.


■サンプル名
MAPI Rules

■フォルダ名
\Common\CPP\Win32\MapiRule

■使用 API
IMailRuleClient, IMailRuleClient::ProcessMessage, IMailRuleClient::Initialize, IMsgStore,IMsgStore::OpenEntry, IMessage, IMAPIProp::GetProps, MAPI Properties

■概要
Demonstrates how to implement a MAPI Rule Client, a COM object which can handleand filter incoming MAPI messages.


■サンプル名
Read View Menu Extension

■フォルダ名
\Common\CPP\Win32\ReadViewMenuExt

■使用 API
Menu Extensibility, IContextMenu, IObjectWithSite, MailComposeMessage

■概要
Demonstrates how to reply to an email message using a default email account.


■サンプル名
Sending E-mail

■フォルダ名
\Common\CPP\Win32\SendMail

■使用 API
Messaging API (MAPI), MAPILogonEx, SRowSet, IMAPISession::GetMsgStoresTable, IMAPISession::OpenMsgStore,IMAPITable::QueryRows, IMsgStore::OpenEntry, IMAPIProp::GetProps, IMAPIFolder::CreateMessage,IMessage::SubmitMessage, MAPIFreeBuffer, FreeProws

■概要
Demonstrates how to use several CEMAPI APIs.


■サンプル名
New Messaging Transport

■フォルダ名
\PocketPC\CPP\win32\TransportDemo

■使用 API
IMailSyncHandler

■概要
Demonstrates how to create a new messaging transport.


■サンプル名
New Message Class

■フォルダ名
\PocketPC\CPP\win32\TV_Inbox

■使用 API
IFormProviderEx, IMailRuleClient

■概要
Implements a new message class appropriate for SMS notifications from your DVR.


■サンプル名
Calling Card

■フォルダ名
Common\CPP\Win32\CallingCard

■使用 API
PhoneMakeCall, IContextMenu::QueryContextMenu

■概要
Demonstrates how to make a calling card call directly from the Contacts screen.


■サンプル名
Get Device's Phone Number

■フォルダ名
\Common\CPP\Win32\GetPhoneNumber

■使用 API
IWebBrowser2, DWebBrowserEvents2

■概要
Demonstrates how to retrieve the phone number of a device.


■サンプル名
Find a Lost Phone

■フォルダ名
\Smartphone\CS\PhoneFinder

■使用 API
State and Notifications Broker, Microsoft.WindowsMobile.PocketOutlook.MessageInterception,Microsoft.WindowsMobile.Status, PlaySound, PInvoke

■概要
Demonstrates how to write an application that helps you locate your phone if youlose it.


■サンプル名
Manage SIM Contacts

■フォルダ名
\Smartphone\cpp\Win32\SIMMgr

■使用 API
SIM Manager, SimDeinitialize, SimGetDevCaps, SimInitialize, SimReadPhonebookEntry,Telephony

■概要
Demonstrates how to add phone numbers to, and delete phone numbers from, a SubscriberIdentity Module (SIM).


■サンプル名
Calendar List View

■フォルダ名
\PocketPC\CPP\win32\CalendarView

■使用 API
CEPROPVAL, GetCursor, IDispatch, IFolder, IItem, InitCommonControlsEx, INITCOMMONCONTROLSEX,IPOutlookApp2, IPOutlookItemCollection, LoadCursor, LVCOLUMN, LVITEM, MSG, SetCursor,SHINITDLGINFO, SHMENUBARINFO

■概要
Demonstrates how to use the POOM IItem interface for appointment items, and POOMnotifications. It displays a list-view with all calendar items.


■サンプル名
Picture Dialer

■フォルダ名
\Common\CPP\Win32\PictureDialer

■使用 API
Pocket Outlook Object Model (POOM), ChooseContact

■概要
Demonstrates how to associate a phone number and picture with a digit in a grid.Pressing the digit will dial the phone number.


■サンプル名
Register a Source Provider

■フォルダ名
\PocketPC\CPP\win32\PimExProvider

■使用 API
CEPROPVAL, IPimSrcContactListIcon::Paint, IPimSrcContactSummaryCard::Display, PIMSRC_COLOR,Source Provider Customization Type Flags

■概要
The following application registers a source provider for the Contacts and Calendarapplications.


■サンプル名
POOM Master

■フォルダ名
\Common\CPP\Win32\PoomMaster

■使用 API
Pocket Outlook Object Model (POOM), IPOutlookApp, IPOutlookItemCollection, ITask,IContact, IAppointment, ListView_InsertItem, Date and Time Picker Controls

■概要
Demonstrates how to use the POOM API. Via an owner-drawn list-view control, POOMMasterdisplays currently stored PIM items (Contacts, Tasks, and calendar Appointments).


■サンプル名
Manage Tasks

■フォルダ名
\Smartphone\cpp\Win32\poomtasks

■使用 API
IPOutlookItemCollection, IRecurrencePattern, ITask

■概要
Demonstrates how to write a Personal Information Manager (PIM)/Messaging applicationthat uses API members from the Pocket Outlook Object Model (POOM) to create, delete,and otherwise manage tasks.


■サンプル名
Task Tree

■フォルダ名
\PocketPC\CPP\win32\TaskTree

■使用 API
Pocket Outlook Object Model (POOM), Custom properties

■概要
Demonstrates how to display tasks in a tree view. Enables user to add new tasksto the tree.


■サンプル名
POOM Application

■フォルダ名
\PocketPC\CS\Pocketoutlooksample

■使用 API
Microsoft.WindowsMobile.PocketOutlook, Microsoft.WindowsMobile.Telephony

■概要
Demonstrates how to write a Personal Information Manager (PIM)/Messaging applicationthat uses API members from the Microsoft.WindowsMobile.PocketOutlook namespace,along with API members from the Microsoft.WindowsMobile.Telephony namespace.


■サンプル名
Add Contacts' Birthdays to Calendar

■フォルダ名
\Common\CS\BirthdaysToCalendar

■使用 API
Microsoft.WindowsMobile.PocketOutlook, Microsoft.WindowsMobile.PocketOutlook.Appointment,Appointment.RecurrencePattern, Recurrence

■概要
Demonstrates how to write a managed Pocket Outlook Object Model (POOM) application.


■サンプル名
Add Picture to Contact

■フォルダ名
\Common\CS\AddPictureToContact

■使用 API
Microsoft.WindowsMobile.Forms.ChooseContactDialog,
Microsoft.WindowsMobile.Forms.SelectPictureDialog,
Microsoft.WindowsMobile.PocketOutlook.OutlookSession,
Microsoft.WindowsMobile.PocketOutlook.Contact

■概要
Demonstrates how to use the ChooseContactDialog and the SelectPictureDialog APIsto select a contact and then attach a picture to it.


■サンプル名
Send Meeting Requests Over SMS

■フォルダ名
\PocketPC\CS\AppointmentOverSms

■使用 API
Pocket Outlook Object Model (POOM), Pocket Outlook Object Model (POOM) API, Microsoft.WindowsMobile.PocketOutlookNamespace

■概要
Demonstrates how to use custom controls to pick an Appointment and a Contact, thensend a meeting request to the Contact over SMS.


■サンプル名
SMSIM

■フォルダ名
\PocketPC\CS\SmsIm

■使用 API
Pocket Outlook Object Model (POOM), MessageInterceptor Class

■概要
Demonstrates how to use C# to write a managed code version of a Short MessagingService (SMS) interception application.


■サンプル名
Add a Contact Picture

■フォルダ名
\Common\CPP\Win32\AddContactPicture

■使用 API
ChooseContact, GetOpenFileNameEx, IItem

■概要
Demonstrates how to allow the user to select a contact (using the Contact Chooser),select a picture (using the Picture Picker), and then adds the selected pictureto the selected contact, and displays the summary card for that contact.


■サンプル名
Rules Client Custom Form

■フォルダ名
\Common\CPP\Win32\CustomForm

■使用 API
IMailRuleClient, IFormProviderEx

■概要
Demonstrates how to implement a Rule Client to capture and process SMS/EMS, processmultipart EMS, and implement a custom read form to display the EMS in the Inboxapplication.


■サンプル名
Power Manager

■フォルダ名
\Common\CPP\Win32\PowerManager

■使用 API
RequestPowerNotifications, StopPowerNotifications, SetPowerRequirement, ReleasePowerRequirement,GetSystemPowerState, SetSystemPowerState

■概要
Demonstrates how an application can use the Power Manager APIs to register for powernotifications, set minimum device power requirements, and get and set the systempower state.


■サンプル名
CE Invoke

■フォルダ名
\PocketPC\CPP\win32\Ceinvoke

■使用 API
CeRapiInvoke

■概要
Demonstrates how to use the CEInvoke API for the client, and for the server.


■サンプル名
Get Device Information

■フォルダ名
\Common\CPP\Win32\Rapi\DeviceInfo

■使用 API
EnumDevices IRAPIDesktop:IUnknown, IRAPIDevice::GetConnectionInfo, IRAPIDevice::GetDeviceInfo,IRAPIDevice:IUnknown, Remote API (RAPI)

■概要
Demonstrates how to use the IRAPI interfaces to get information about the WindowsMobile-based device connected through ActiveSync and the corresponding communicationmedium used. Once the information is collected, it is printed on the console window.


■サンプル名
List a Directory and its Files

■フォルダ名
\Common\CPP\Win32\Rapi\Pdir

■使用 API
CeRapiInit, CeFindFirstFile, CeFindNextFile, CeFindClose, CeRapiUninit

■概要
This application runs on a desktop host computer, and demonstrates how to list adirectory's files and directories on a Mobile device.


■サンプル名
Copy a File from a Device

■フォルダ名
\Common\CPP\Win32\Pget

■使用 API
CeRapiInit, CeReadFile, CeCloseHandle, CeRapiUninit

■概要
This application runs on a desktop host computer, and demonstrates how to copy afile from a Mobile device to a desktop computer.


■サンプル名
Copy a File to a Device

■フォルダ名
\Common\CPP\Win32\Pput

■使用 API
CeRapiInit, CeWriteFile, CeCloseHandle, CeRapiUninit

■概要
This application runs on a desktop host computer, and demonstrates how to copy afile from the desktop computer to a Mobile device.


■サンプル名
Retrieve Registry Settings

■フォルダ名
\Common\CPP\Win32\Pregdmp

■使用 API
CeRapiInit, CeRegEnumKeyEx, CeRegOpenKeyEx, CeRegEnumValue, CeRegCloseKey, CeRapiUninit

■概要
This application runs on a desktop host computer, and demonstrates how to retrievea Mobile device's list of registry settings.


■サンプル名
Execute an Application on a Device

■フォルダ名
\Common\CPP\Win32\Prun

■使用 API
CeRapiInit, CeCreateProcess, CeCloseHandle, CeRapiUninit

■概要
This application runs on a desktop host computer, and demonstrates how to executean executable file on a Mobile device.


■サンプル名
List all Directories and their Files

■フォルダ名
\Common\CPP\Win32\Ptree

■使用 API
CeRapiInit, CeFindAllFiles, CeRapiFreeBuffer, CeRapiUninit

■概要
This application runs on a desktop host computer, and demonstrates how to list allof the files and directories on a Mobile device.


■サンプル名
Communication with Sockets

■フォルダ名
\Common\CPP\Win32\SockApp

■使用 API
EnumDevices, IRAPIDesktop:IUnknown, IRAPIDevice::GetConnectionInfo, IRAPIDevice:IUnknown

■概要
Demonstrates how to use sockets to communicate with a Windows Mobile-based device.At first hand, the application uses IRAPI interfaces to get the IP of the WindowsMobile connected through ActiveSync. In a second step, it sends a hello string andlisten for the mobile device to respond back


■サンプル名
RAPI EDB Database Application

■フォルダ名
\Common\CPP\Win32\Rapi\EdbRapi

■使用 API
RAPI, EDB

■概要
Demonstrates how to use RAPI to access EDB databases.


■サンプル名
Card Autorun

■フォルダ名
\Common\CPP\Win32\Autorun

■使用 API
SHGetAutoRunPath

■概要
Demonstrates how to handle Autorun notifications when an MMC card is inserted/removedfrom the mobile device.


■サンプル名
Basic Shell

■フォルダ名
\Common\CPP\Win32\BasicApp

■使用 API
RegisterClass, CreateWindow, SetForegroundWindow, SHCreateMenuBar, SHInitDialog,SHGetUIMetrics, SHHandleWMActivate, SHHandleWMSettingChange, SHLoadImageResource,WM_HIBERNATE

■概要
Demonstrates how to implement a basic application that uses the major Shell APIsto interact properly with the Windows Mobile OS.


■サンプル名
Calendar and DTP Controls

■フォルダ名
\PocketPC\CPP\win32\CalendarAndDTP

■使用 API
Date and Time Picker Controls

■概要
Demonstrates how to use the Calendar and date and time picker controls.


■サンプル名
Context Menu Extension Handler

■フォルダ名
\PocketPC\CPP\win32\CtxMenu

■使用 API
IContextMenu

■概要
Demonstrates how to implement a context menu extension handler, and specificallyone that extends the context menu in File Explorer when tapping and holding on afile.


■サンプル名
Currency Converter

■フォルダ名
\Smartphone\cpp\Win32\Currency

■使用 API
CreateMutex, SHCreateMenuBar, SetFocus

■概要
Demonstrates how to port an application written for Pocket PC, and port it to Smartphone.


■サンプル名
File System Browser

■フォルダ名
\PocketPC\CPP\win32\DirTree

■使用 API
FindFirstFile, FindNextFile, Tree View Controls Reference

■概要
Demonstrates how to browse the file system and display all directories and filesby name.


■サンプル名
Dynamic Menu

■フォルダ名
\PocketPC\CPP\win32\Dynamenu

■使用 API
SHGetSubMenu, SHSetSubMenu, CheckMenuRadioItem, CheckMenuItem, InsertMenu, DeleteMenu

■概要
Demonstrates techniques for using, getting, and setting menu handles on Pocket PC.


■サンプル名
File Change Notification

■フォルダ名
\PocketPC\CPP\win32\FileChangeNotif

■使用 API
SHChangeNotifyRegister, SHChangeNotifyDeregister

■概要
Demonstrates how to listen for changes to the file system.


■サンプル名
Full Screen

■フォルダ名
\Common\CPP\Win32\FullScreen

■使用 API
SHFullScreen, SHCMBM_OVERRIDEKEY

■概要
Demonstrates how an application can make full use of the device screen for displayingcontent using several shell APIs.


■サンプル名
SIP Handles

■フォルダ名
\PocketPC\CPP\win32\HandleSIP

■使用 API
SipGetInfo, Common Controls, Software-Based Input Panel

■概要
Demonstrates how to use SIP functions.


■サンプル名
HTML Viewer Host

■フォルダ名
\PocketPC\CPP\win32\HTMLHost

■使用 API
Creating HTML Control

■概要
Demonstrates the programmatic accessibility of the HTML Viewer control and producesdebug output based on the user actions within the control.


■サンプル名
Hardware Navigation

■フォルダ名
\PocketPC\CPP\win32\HWNavigation

■使用 API
WM_GETDLGCODE

■概要
Demonstrates how focus moves around a dialog when the user performs various hardwarenavigation actions.


■サンプル名
Inbox Menu Extensions

■フォルダ名
\Common\CPP\Win32\InboxMenuExtensibility

■使用 API
Menu Extensibility, IContextMenu, IObjectWithSite, IMAPIFolder::DeleteMessages,IMAPIFolder::CopyMessages

■概要
Demonstrates how to add items to the menus which are seen while in the message listview within the Inbox (tmail.exe).


■サンプル名
Ink2

■フォルダ名
\PocketPC\CPP\win32\Ink2

■使用 API
RichInk Control Reference

■概要
Demonstrates how to stream rtf and txt formatted data into and out of a RichInkcontrol.


■サンプル名
Inky

■フォルダ名
\PocketPC\CPP\win32\inky

■使用 API
RichInk Control Reference

■概要
Demonstrates the capabilities of the RichInk control.


■サンプル名
List Views

■フォルダ名
\PocketPC\CPP\win32\ListView

■使用 API
ListView control.

■概要
Demonstrates techniques for using the List-view Control.


■サンプル名
Memory Watcher

■フォルダ名
\PocketPC\CPP\win32\MemWatcher

■使用 API
Today Screen

■概要
Demonstrates how to create a custom Today screen item for Pocket PC.


■サンプル名
Custom plug-in sample

■フォルダ名
PocketPC\cpp\win32\Memwatcher

■使用 API
Today screen plug-in sample.

■概要
Demonstrates how to create a custom Today screen item for Pocket PC.


■サンプル名
Menu

■フォルダ名
\PocketPC\CPP\win32\Menu

■使用 API
Menu Extensibility

■概要
Demonstrates how to append, create, and insert sub menu items.


■サンプル名
My Backlight

■フォルダ名
\PocketPC\CPP\win32\myBackLight

■使用 API
CPlApplet

■概要
Demonstrates how to create a simple control panel application for a Windows Mobile-basedPocket PC device.


■サンプル名
Shell notifications

■フォルダ名
\PocketPC\CPP\win32\notifications

■使用 API
SHNotificationAdd, SHNotificationUpdate, SHNotificationRemove

■概要
Demonstrates how to add, update and remove tray notifications.


■サンプル名
NotifyMFC

■フォルダ名
\PocketPC\CPP\MFC\notifyMFC

■使用 API
SHNotificationAdd, SHNotificationUpdate, SHNotificationRemove

■概要
Demonstrates the capabilities and options of the Pocket PC notifications and alertsAPI.


■サンプル名
Owner Drawn List-View

■フォルダ名
\Common\CPP\Win32\OwnerListView

■使用 API
ListView_GetItem, Win32 Classes, GDI Reference

■概要
Demonstrates how to implement an owner drawn List-view control. Also demonstrateshow to use various List-view notification events.


■サンプル名
Project Enumeration

■フォルダ名
\PocketPC\CPP\win32\ProjectEnumeration

■使用 API
File and Application Management API, FindWindow, OPENFILENAME, SHMENUBARINFO

■概要
Demonstrates the Project document and file manipulation API.


■サンプル名
Registry Viewer

■フォルダ名
\PocketPC\CPP\win32\Regviewer

■使用 API
RegOpenKeyEx, RegQueryInfoKey, RegEnumValue, RegEnumKeyEx

■概要
Demonstrates to a Pocket PC registry viewer application.


■サンプル名
Resolve Host

■フォルダ名
\PocketPC\CPP\win32\Resolve

■使用 API
Winsock Application Development, gethostbyaddr, gethostbyname

■概要
Demonstrates how to resolve a host name (e.g. www.microsoft.com) into an IP address,or an IP address into a host name.


■サンプル名
Shell Demo

■フォルダ名
\PocketPC\CPP\win32\ShellApiDemo

■使用 API
SHInitDialog, SHDoneButton, SHSetNavBarText, SHFullScreen, SHGetAutoRunPath, SHCreateMenuBar,SHEnableSoftkey

■概要
Demonstrates the Shell API's. It demonstrates how to show/hide task bars, menu bars,and SIP buttons. It also shows how to use SHInitDialog for full screen dialogs,and use SHCreateMenuBar in different ways.


■サンプル名
Spin Test

■フォルダ名
\PocketPC\CPP\win32\Spintest

■使用 API
Common Controls, CreateWindow

■概要
Demonstrates the implementation and use of a custom control (SpinCube).


■サンプル名
Tray Application

■フォルダ名
\PocketPC\CPP\win32\Trayapp

■使用 API
Shell_NotifyIcon

■概要
Demonstrates how to put an icon on the tray on the today page. It also shows howto do a popup dialog from that icon.


■サンプル名
Tray Task List

■フォルダ名
\PocketPC\CPP\win32\Traytasklist

■使用 API
Shell_NotifyIcon, CreateToolhelp32Snapshot, Process32First, Process32Next

■概要
Demonstrates how to get a list of running tasks (and their window names) into apopup item on the tray.


■サンプル名
Terminal Emulator

■フォルダ名
\PocketPC\CPP\win32\Tty

■使用 API
CloseHandle, COMMTIMEOUTS, CreateFile, CreateThread, DCB, EscapeCommFunction, GetCommModemStatus,GetCommState, GetCommTimeouts, GetLastError, MessageBox, SetCommMask, SetCommState,WaitCommEvent

■概要
Demonstrates how to open, configure, and close a serial communications port andperform read/write operations for a TTY terminal emulation application.


■サンプル名
Virtual List-View

■フォルダ名
\Common\CPP\Win32\VirtualListView

■使用 API
ListView_SetItemCount, ListView_SetExtendedListViewStyle, ListView_GetExtendedListViewStyle,ListView_SetImageList, ListView_InsertColumn

■概要
Demonstrates how to use a virtual list view.


■サンプル名
Capture Back Button Press Events

■フォルダ名
\Smartphone\cpp\Win32\back

■使用 API
SHCMBM_OVERRIDEKEY, SHNavigateBack

■概要
Demonstrates how to detect when the Back Button is pressed on Smartphone, and howyou can programmatically interact with it.


■サンプル名
Close all Child Windows

■フォルダ名
\Smartphone\cpp\Win32\CloseWindow

■使用 API
GetWindow, GetWindowThreadProcessId, IsWindowVisible, IsWindowEnabled

■概要
Demonstrates how to force an application to revert back to its base state when itis relaunched, and how to destroy a chain of child windows.


■サンプル名
Dvorak Soft Input Panel

■フォルダ名
\PocketPC\CPP\ATL\DvorakSIP

■使用 API
IInputMethod, ATL, COM

■概要
Demonstrates how to create a custom Soft Input Panel (SIP) as a COM object. It isintended to help users and service providers in foreign countries support differentlanguages in the SIP. The application is a COM component that implements the IInputMethodInterface.


■サンプル名
Create a Custom Home Screen

■フォルダ名
\Smartphone\cpp\Win32\HomeScreen

■使用 API
IHomePlugin, IPersistStream:IPersist, IHomePluginEnvironment

■概要
待ち受け画面(ホーム画面)をカスタマイズする。あらかじめ、SDKSamplePrivDeveloperの認証をインストールしないといけない。 Requires the installation of the SDKSamplePrivDeveloper certificate.


■サンプル名
Create Soft Key Menus

■フォルダ名
\Smartphone\cpp\Win32\MenuDemo

■使用 API
AYGShell, SHCreateMenuBar, SHMENUBARINFO

■概要
Demonstrates how to create and manipulate Soft Key menus.
ソフトキーメニューの作成と実装。

■サンプル名
Create a Custom Input Method

■フォルダ名
\Smartphone\cpp\Win32\PhoneIme

■使用 API
SHImeSetCustomInputIcons, SHImeSetModeIcon, SHImeOnKeyPress, SHImeGetClearMessage

■概要
Requires the installation of the SDKSamplePrivDeveloper certificate.


■サンプル名
Multiple CAB Install

■フォルダ名
\Common\CPP\Win32\multicabinstall

■使用 API
Setup DLL, WCELoad

■概要
Demonstrates how to create a program to unpack all
the cabs in a container cab ('uber-cab').


■サンプル名
State and Notification Broker Viewer

■フォルダ名
\PocketPC\CS\StateAndNotificationBrokerViewer

■使用 API
State and Notifications Broker, Microsft.WindowsMobile.Status Namespace

■概要
Demonstrates how to get both state values and state change notifications from theState and Notifications Broker.


■サンプル名
Battery Status

■フォルダ名
\PocketPC\CPP\win32\battstat

■使用 API
RegistryGetDWORD, RegistryNotifyWindow, RegistryNotifyCallback, RegistryNotifyApp

■概要
Demonstrates how to use the State and Notification Broker APIs to get notified ofthe battery strength.


■サンプル名
Get Device ID

■フォルダ名
\Common\CPP\Win32\GetDeviceID

■使用 API
GetDeviceUniqueID

■概要
Demonstrates how to protect the privacy of a device. Multiple applications needto use a device's unique identifier to communicate with servers. To protect a device'sprivacy, multiple servers should not be able to correlate data from the same device.


■サンプル名
Process Viewer

■フォルダ名
\Common\CPP\Win32\PViewCE

■使用 API
CreateToolhelp32Snapshot

■概要
Demonstrates a process viewer for CE devices.


■サンプル名
Reversi

■フォルダ名
\PocketPC\CPP\win32\Reversi

■使用 API
CheckMenuItem, CreateWindow, DeleteObject, DialogBox, DispatchMessage, Ellipse,EndDialog, EndPaint, ExtTextOut, GetClientRect, GetDC, GetDeviceCaps, GetStockObject,GetSystemMetrics, GetTextExtentExPoint, GetTextMetrics, DefWindowProc, KillTimer,LoadAccelerators, LoadImage, LoadCursor, LocalAlloc, LocalFree, MessageBox, PostMessage,Rectangle, RegisterClass, ReleaseCapture, ReleaseDC, SelectObject, SetBkMode, SetCapture,SetFocus, SetTimer, SetWindowText, ShowWindow, TranslateAccelerator, TranslateMessage

■概要
Implements the Reversi game for Pocket PC. It demonstrates drawing, game logic,and a recursive MiniMax algorithm.


■サンプル名
SliderPuzzle

■フォルダ名
\Smartphone\CS\SliderPuzzle

■使用 API
System.DrawingNamespaceSystem.Drawing Namespace, System.Windows.Forms NamespaceSystem.Windows.Forms Namespace

■概要
Demonstrates how to write a Smartphone application in C#. The application is a gamewhere the object is to unscramble the tiles. You can only slide the puzzle piecesinto the space that is empty.


■サンプル名
WebCrawler

■フォルダ名
\PocketPC\CS\WebCrawler

■使用 API
System.CollectionsNamespaceSystem.Collections Namespace, System.Diagnostics NamespaceSystem.Diagnostics Namespace,System.IO NamespaceSystem.IONamespace, System.Net Namespace, System.Text.RegularExpressions NamespaceSystem.Text.RegularExpressionsNamespace, System.Threading NamespaceSystem.Threading Namespace, System.Windows.Forms NamespaceSystem.Windows.Forms Namespace

■概要
Demonstrates how to use managed code to write a C# Windows Mobile application. Theapplication counts the links on a web site, and also counts all of the links thatbranch from the web site. When done, WebCrawler displays a listing of theresults.


■サンプル名
CompactNav

■フォルダ名
\Smartphone\CS\CompactNav

■使用 API
List-View Controls Reference, PInvoke

■概要
Demonstrates how to implement a basic .NET Compact Framework file-system navigator, as well hashow to use "Platform Invoking" (PInvoke) to make calls to unmanaged APIs (in this case,CreateProcess).


■サンプル名
GPS

■フォルダ名
\PocketPC\CS\GPS

■使用 API
GPS Intermediate Driver Reference, PInvoke, System.Runtime.InteropServicesSystem.Runtime.InteropServices,System.ThreadingNamespaceSystem.Threading Namespace, System.Windows.Forms NamespaceSystem.Windows.Forms Namespace

■概要
Demonstrates how to use managed code to write a C# Windows Mobile Global PositioningSystem (GPS) application. This code sample demonstrates how to wrap the native GPSAPIs in a C# class. It demonstrates how to use "Platform Invoking" (PInvoke)to make calls to unmanaged APIs (in this case, CreateProcess).


■サンプル名
Mobile GPS

■フォルダ名
\Common\CPP\Win32\gps\

■使用 API
GPS_DEVICE, GPS_POSITION, GPSCloseDevice, GPSGetDeviceState, GPSGetPosition, GPSOpenDevice

■概要
Demonstrates how to use native GPS Intermediate Driver Reference to asynchronouslyretrieve the location data and the GPS Intermediate Driver state.


■サンプル名
MUIHello

■フォルダ名
\Smartphone\cpp\Win32\muihello

■使用 API
Input Method Manager (IMM) Reference, Multilingual User Interface (MUI) Reference,National Language Support (NLS) Reference

■概要
Demonstrates how to write a Multilingual User Interface (MUI) version of a "HelloWorld!" application.


■サンプル名
Windows Mobile Ink Text Recognition

■フォルダ名
\PocketPC\CPP\win32\WISPLite\BasicRecognition

■使用 API
WispLite, InkCanvas

■概要
Demonstrates how to use WISP Lite to to allows a user to input text with the stylus,and then use WISPLite to recognize the text.


■サンプル名
Windows Mobile Ink Notes

■フォルダ名
\PocketPC\CPP\win32\WISPLite\InkNotes

■使用 API
WispLite, InkCanvas

■概要
Demonstrates how to use WISP Lite to allows a user to view and edit ink notes. Theseink notes can also be imported to OneNote on the desktop.


■サンプル名
Windows Mobile Ink Serialization

■フォルダ名
\PocketPC\CPP\win32\WISPLite\InkSerialization

■使用 API
WispLite, InkOverlay and InkExtendedProperties

■概要
Demonstrates how to use WISP Lite to allow a user to sign on a region and save thesignature along with the user's name in a file.




■サンプル名
Windows Media Player Application

■フォルダ名
\PocketPC\CPP\ATL\WmpSample

■使用 API
Windows Media Player OCX

■概要
Demonstrates how to use the Windows Media Player ATL control from a Win32 application.


■サンプル名
Windows Media Player Home Plug-in

■フォルダ名
\Smartphone\CPP\Win32\MediaPlayerHomePlugin

■使用 API
IHomePlugin, IPersistStream, IHomePluginEnvironment2, IWMPPluginUI,
IWMPEvents

■概要
Implements a homescreen plug-in that allows the user to view information about thecurrent media item playing in Windows Media Player, and provides controls to pauseor restart playback, to move to the next media item in the current playlist, andto move to the previous media item in the current playlist.


[ギター] BUMPの天体観測

延々弾いてる。楽しい。

[Ruby] HpricotのParseミス

とあるサイト、例えば Yahoo! なんかの大手でも
<form>
<table>
<tr><td></td></tr>
</table>
</form>
とするべきところを

<table>
<tr>
<form>
</td></tr>
</form>
</table>

みたいになってる本当にわけの分からない
(<td>が欠けてるし)
HTML が表示されてたりする

これをパースしようとすると、
'form'でのパース結果に "<form></td>"
なんて壊れたのが入ったりする。

さらにこれを
Mechanize::Formに入れると
もっとゴミだらけの Formオブジェクトが返ってきてしまう。

まず、Mechanize::Formが
Malformed な HTML で変な Form オブジェクトを返すのが納得いかない。

でも例えそこが正常に動いたとしても、
そもそも 'form'のパース結果が "<form></td>"
では、正しい Formオブジェクトが作れない。

そこで、HPricot のパース処理から手を加えなくてはいけない
(Mechanize::Page を外部から編集できればそれが一番いい)

[Ruby] Hpricot 上手くいかない具体例

p Hpricot.parse( "<table><tr><form><td></td></tr></form></table>" )/'form'

p Hpricot.parse( "<table><form><tr><td></td></tr></form></table>" )/'form'

上は、間違ったところに<tr>があるせいで、
</tr>以降が全て無視されてしまう

[Ruby] Hpricotでパースが上手くいかないの修正

Mechanize は内部でパース処理に Hpricot を使ってるけど
Hpricot に<a><b></a></b> みたいな HTML を与えると
パースできない(それはそうだ)って話。

それが <form> とかだと
Mechanize の魅力半減どころか使い物にならねーぞ
ということで修正

どこを修正するか色々迷ったんだけど
Page.rb の Class Page にこいつらを追加
def parse_html への修正

@ex_forms = WWW::Mechanize::List.new

# Find all the form tags other way
body.scan( /<form.*?<\/form>/m ) do |m|
    local_parser = Hpricot.parse( m )
    (local_parser/'form').each do |html_form|
     form = Form.new(html_form, @mech )
     form.action ||= @uri
     @ex_forms << form
    end
end

[Ruby] さっきの修正は

ようするに、Hpricot は修正してないので
勘違いした人はゴメン

「Mechanize で form がうまく解析できない場合に」
というのが正しかった。

本日のツッコミ(全5986件) [ツッコミを入れる]

Before...

_ Jqslypmg [comment5, <a href="http://www.vbdesigns.de/member.php?u=39..]

_ Ewhvcelg [comment6, <a href="http://www.excel-downloads.com/forum/me..]

_ weigouh [ http://aaczewf.angelfire.com/brshr.html http://mmvvior.o-..]

本日のリンク元 | 5 | 4 | 4 | 4 | 4 | 4 | 3 | 3 | 3 | 3 |

2007/07/03

[Ruby] exerb と ruby/tk

*.exy のフォーマットをきちんと勉強すればよかった

作ってたスクリプトが require 'tk' なやつだったんだけど、
同じフォルダに tk の実験用に作った tk.rb が置いてあった
require 'tk' は多分実験用のtk.rbを見に行くんだけど
tk.rb の中でも require 'tk' してるから、
そっちはちゃんとruby/tkを見に行ってると思う
それでちゃんと動いてたのね

でも mkexy によるレシピは、
実験用のtk.rbを見に行くところで止まっちゃってたから
本来のruby/tkが圧縮候補に入っていなかった

さらにtk.rbでエラーが起きてたから、
ruby/tk のほうを見に行ったんだけど、
まったく対応するような行が無くて混乱した

なんというロスタイム…

本日のツッコミ(全1161件) [ツッコミを入れる]

Before...

_ bazylanura [ http://gaigebullo.freeweb7.com/829.html recurve bow game..]

_ pieosvbwvu [FkJiyi <a href="http://nrvhrgxnnnoi.com/">nrvhrgxnnnoi</a..]

_ fbdiluqpc [zeOrLA <a href="http://uguqrxuepzcu.com/">uguqrxuepzcu</a..]

本日のリンク元 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/04

[Ruby] exerb と Tk の終了

Ruby/Tk を使ったプログラムを
exerb でexe化したところ、
終了ボタンを押してもタスクが残ってしまう。

何か適切なオプションでもあるのだろうか

Tk.root.protocol("WM_DELETE_WINDOW", proc{
    Tk.exit
    exit!( 0 )
} )
することで終了するようになったけど、
ということは例外が起きているのだろうか
(exit と exit! の違いは例外の有無だったと思う)

[inside] バッチファイルで tk プログラムを mkexy exerb

まずは、exerb の samples を参考に、
tk 用のおまじないをコードに施す。

プログラム冒頭
def autoload(mod, fname)
end

TkEvent = Module.new
TkPack = Module.new
TkWinfo = Module.new

require 'tk'
require "tk/event"
require "tk/winfo"
require 'tk/root'
require 'tk/pack'

プログラムの、Tk.mainloop 部
unless defined?(Exerb)
    Tk.mainloop
end

これで mkexy がつつがなく行われるはず

そのままバッチに
mkexy sample.rb
exerb sample.exy

を記述すると、
mkexy したところで止まってしまう。
(これ、バッチでよくあるけど
 どういう時に起こる現象なのでしょうか?)

そこで、
mkexy_sample.batに

echo on
mkexy sample.rb

exerb_sample.batに

echo on
exerb sample.exy

をそれぞれ記述して

make_sample.batに

call mkexy_sample.bat
call exerb_sample.bat

と記述すればよい、
あとはこのバッチたたくだけでexe化

本日のツッコミ(全131件) [ツッコミを入れる]

Before...

_ Halo [<a href= http://chaptersummaryofkiterunner.motherauts.info..]

_ Diesel [<a href= http://dragonquestviiiwalkthrough.liveauts.info/ ..]

_ Heel [<a href= http://robertdyrdekbiography.moreauts.info/ >robe..]

本日のリンク元 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/05

[Ruby] exerb なアプリで DOS 窓を消す方法

どうしたものかなーと思っていたのだけど
Jewel-mmo 開発日記さんのところで解説されていた。

レシピファイル内の
core: cui → core: gui でいけるらしい
いちおう exerb のリファレンスは見に行ったのだけど
オプションだとばかり思い込んでいた。

やっぱりレシピファイルのフォーマットは
把握しておく必要がありそう…。

早速バッチに組み込むんでおいた

data = nil
open("sample.exy","r"){ |f| data = f.readlines.join }
open("sample.exy","w"){ |f| f.print data.gsub( /core: cui/, 'core: gui' ) }

多謝!!

本日のツッコミ(全59件) [ツッコミを入れる]

Before...

_ manaudou sex video [comment3, <a href="http://www.justin.tv/arab_gay_sex_video..]

_ horny teen sex videos [comment5, <a href="http://www.justin.tv/force_sex_videos_0..]

_ Lorazepam [Nise site., http://www.youtube.com/MelvinAtwell Ambien, 0..]

本日のリンク元 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/06

[Windows Mobile 6] SDK によるコントロールの違い

Windows Mobile 6 は SDK が2つあるわけだけど、
それらの間でコントロールの違いが激しすぎる。

いっそ全部ラベルで作って
自分でリストボックスや時間コントロール
実装してったほうがいいんじゃないかってくらい。

本日のツッコミ(全880件) [ツッコミを入れる]

Before...

_ name [comment1, ]

_ name [comment2, ]

_ name [comment5, ]

本日のリンク元 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/09

[ダーツ] はじめました

ビリヤードも好きなので、両方やるのはどうかなーと思ったけど。
面白い!集中力が必要だし(集中するの好き)
色々買わなくては。
マイダーツはそうだけど、ハウスダーツも買って
オールマイティに楽しめるようにする!
(高得点とかは興味ないや)

テレビダーツも欲しいなー。

本日のツッコミ(全2006件) [ツッコミを入れる]

Before...

_ free phentermine prescriptions [4 http://www.clevver.com/noahsarahx free phentermine presc..]

_ serious side effects of xanax [3 http://losangeles.metromix.com/user/profile/117626 serio..]

_ cialis generic soft [2 http://dominicautumnz.easyfreeforum.it/ cialis generic s..]

本日のリンク元 | 4 | 3 | 3 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |

2007/07/19

[Windows Mobile 6] 受信トレイの内容を取得

POOM を使ってできるかなーと思ったのだけど
IPOutlookApp::GetDefaultFolder( ) に渡す引数に、
olFolderInbox がないじゃないか。

うーん、どうすればいいかな

本日のツッコミ(全407件) [ツッコミを入れる]

Before...

_ jonnie2 [comment1, ]

_ IVmPhdWQB [01may-06may-2009]

_ zFCgXEVFHezbGclp [01may-06may-2009]

本日のリンク元 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/20

[Windows Mobile 6] 受信トレイの中身を取得

試しに

IPOutlookApp *polApp;
IFolder *pFolder;
HRESULT hr;

const int olFolderInbox = 6;
hr = polApp->GetDefaultFolder( olFolderInbox, &pFolder );

しても、hr = E_INVALIDARG が返ってきてしまうので、
どうしたものか。プライバシーとかで、そもそも取得できないの?

[Windows Mobile 6] 受信トレイの取得の続き

そもそもpimstore.hには、取得できるフォルダは
enum OlDefaultFolders
    {   olFolderCalendar    = 9,
        olFolderContacts    = 10,
        olFolderTasks       = 13,
        olFolderCities      = 101,
        olFolderInfrared    = 102,
    } OlDefaultFolders;
と規定されているわけだけど、
これ以外にも取得できないかと、10000までforでまわしてチェックした。

でも、やっぱり
olFolderCalendar=9
olFolderContacts=10
olFolderTasks=13
olFolderInfrared=102
しか取得できなかった。

olFolderCities=101に関しては
hr=E_NOTIMPLが返ってきた

[Windows Mobile 6] 受信トレイの取得の続き2

msgstor.h と msgstor2.h を使った古いサンプルを見つけたけど
これは現在のバージョンの SDK ではサポートされていないので、
MAPI (Messaging API) におきかえないといけないらしい。

MAPI 何が使えるかをしらべよう

[murmur] Visual Studio で Ctrl+Cを

Visual Studio で Ctrl+Cを
何も選択しない状態で押すと、
その行全体をコピーしてしまうのが嫌い

あせってガチャガチャ打っているときに、
にCtrl+VしようとしてCtrl+Cしてしまって(未だに)
クリップボードが上書きされてしまうんだ。

[murmur] 民主党って…

給料もらってて何もしない政党でしょう?
政権をとれたら政権をとれたらって

政党って与党以外は何もできないってわけじゃねーぞ、と
マスコミのヨイショも分かりやすくて笑える

僕は、選挙区新風、比例も新風
インターネットを選挙に活用することに
一番理解のある政党だから

選挙を何度やろうが、
投票率が低い限りは、何もかわらないんだ

[Windows Mobile 6] 受信トレイの取得の続き3

ここら辺のインタフェースと
IMAPISession
IMAPITable
IMsgStore
IMAPIProp
IMAPIFolder
IMessage
この記事と
SDK のサンプルの 「SendMail」 を使えば、
なんとかなりそうな気がしてきた。

でも今日は疲れたから残りは誰かやってくれないかなー

本日のツッコミ(全872件) [ツッコミを入れる]

Before...

_ Prozac [Hi All, http://www.aeroxp.org/board/index.php?showuser=529..]

_ Carisoprodol [Nise Site, http://www.123flashchat.com/community/members/v..]

_ Cheap Tadalafil [Good Day, http://www.123flashchat.com/community/members/ma..]

本日のリンク元 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/23

[murmur] KBってKnowledge Base

マイクロソフトの、翻訳されたドキュメントには
最初に「このサポート技術情報 (以下 KB) は」という
ことわりが入っている

KB ってなんだ? と思いつつも
知らなくても困ることないのでスルーしてたけど
今日、またあるドキュメントを読んでいたら
こんなくだりが

以下の「サポート技術情報」 (Microsoft Knowledge Base) を

なるほどねー。
「サポート」も「技術」も「情報」も、普通に訳したら
K も B も登場しない単語だと思ってたけど
Knowledge Base って言われると、なんか納得だわ

[Windows Mobile 6] 受信トレイの取得の続き4

この記事を参考に作業してたわけだけど
UlRelease と HrQueryAllRows は Pocket PC だと利用できないかも。
少なくとも、cemapi.lib には実装がないみたい。
mapiutil.hに定義はあるのだけど…。

こういう時に、含まれている lib を見つけるには
どうすればいいんだろう。

MSDN を入れておけばいいのかな。
入れそびれてそのままになっている…。

[murmur] 印刷用 = Printer Friendly Version

印刷用 = Printer Friendly Version

MSDN で見かけた
この言い回しはカッコイイな。

本日のツッコミ(全1504件) [ツッコミを入れる]

Before...

_ jonnie2 [comment6, <a href="http://www.mbhooverphoto.com/_img/defa_..]

_ jonny3 [comment6, <a href="http://www.printdoctorlfp.com/mason/fil..]

_ jonnik1 [comment5, <a href="http://editorialservices.net/_images/wh..]

本日のリンク元 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/24

[Windows Mobile 6] モーダルなメッセージボックス

メモとして書いておこう。
CFormView 内で MessageBox() 関数を使っていて、
なぜか一箇所だけモーダルにならないなー
と思っていたら、そこだけ
グローバルな
::MessageBox() に、第一引数は NULL を渡して呼んでいた。

朝からロスです…

[Ruby] TkCombobox の リストボックス選択イベント

Ruby の Tk サンプルに、
TkComboboxを見つけたので使ってみた

'<ListboxSelect>' で bind しようとしたら
イベントが飛んでこない。

中を見たら、TkCombobox < TkEntry
つまり、TkCombobox は TkEntry を継承してるけど、
リストのほうは @lst にインスタンスを保持してるだけみたい

TkCombobox内に

  def get_list()
    @lst
  end

みたいにして @lst を取れるようにして

cmb_list = TkCombobox.new
cmb_list.get_list.bind '<ListboxSelect>', proc{ p "hoge" }
これでオケ

[murmur] ファイル操作系の語句

Read と Write だったり
Put と Get だったり
Load とか Save だったり
ここら辺の方言ってひどいよね

本日のツッコミ(全92件) [ツッコミを入れる]

Before...

_ xcoagrh [http://xanga.com/studentndr student loan programs http://..]

_ gcnuwqq [http://xanga.com/freehotuge free hot anime girl wallpaper ..]

_ dwxxbcc [http://usefullhost.info/ins777h/progressive-direct-car-ins..]

本日のリンク元 | 3 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 1 | 1 |

2007/07/26

[Windows Mobile 6] 受信トレイの取得その後

各メールのプロパティはとれるようになった(はず)なので
PR_SUBJECT なんかを取得したら、きちんとメールの件名が返ってきた

そこで
PR_BODY_HTML
CE_MIME_TEXT
PR_BODY
のどれかで本文が返ってくるかと思ったら、返ってこない。 なぜ…。

nakka.comさんで、メーラーのソースを公開しているので、
これを参考に組んでみようかな。

本日のツッコミ(全394件) [ツッコミを入れる]

Before...

_ jonnie2 [comment1, <a href="http://www.billgrant.net/mark/Winners/_..]

_ jonnie2 [comment5, <a href="http://www.raulybarra.com/cursos/cursos..]

_ jonnik1 [comment6, <a href="http://www.raulybarra.com/museos/minas_..]

本日のリンク元 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/27

[Windows Mobile 6] メッセージストアを開く処理

ってこれでいいのかな
変なことしてたら教えて欲しいです…

// メッセージストアを開いて返す
// 戻り値の IMsgStore* は要開放
IMsgStore* GetMsgStore()
{
    // メッセージの情報とメッセージのあるフォルダへのアクセスを提供する
    IMsgStore*        pStore        = NULL;
    // あるデータのテーブルに対して、レイアウトをカスタマイズするために使用される
    IMAPITable*        pTable        = NULL;
    // MAPI セッションのポインタ
    ICEMAPISession*    pSession    = NULL;
    // 処理の結果
    HRESULT            hr;

    // 初期化
    hr = MAPIInitialize( NULL );
    // ログオン(MAPI使うなら必ず)
    hr = MAPILogonEx( 0, NULL, NULL, 0, (LPMAPISESSION *)&pSession );
    // メッセージストアのテーブルを取得する
    hr = pSession->GetMsgStoresTable( MAPI_UNICODE, &pTable );

    // データのテーブルの1行を格納する作業変数
    SRowSet* pRowStore = NULL;
    // メッセージストアのテーブルから1行取得
    if ( SUCCEEDED( pTable->QueryRows(1, 0, &pRowStore) ) ) {
        // メッセージストアを開く
        hr = pSession->OpenMsgStore(
            // 無視される
            NULL,
            // lpEntryID によって決まるバイト数
            pRowStore->aRow[0].lpProps[0].Value.bin.cb,
            // 開こうとするメッセージのIDへ参照
            (ENTRYID *)pRowStore->aRow[0].lpProps[0].Value.bin.lpb,
            // 無視される
            NULL,
            // 無視される
            0,
            // メッセージストアへの参照
            &pStore );
    } else {
        // エラー処理
    }

    // QueryRows のAPI仕様書によると要開放
    FreeProws( pRowStore );
    // MAPI 終了処理
    MAPIUninitialize();

    // 開放
    if ( pTable != NULL ) {
        pTable->Release();
    }

    // 開放
    if ( pSession != NULL ) {
        pSession->Release();
    }

    // ログオフ
    hr = pSession->Logoff( NULL, NULL, 0 );

    // ここにメッセージストアが入っているといいな
    return pStore;
}

[murmur] バッチ 終了 DOS窓を消す

どこからもリンクしてないけど robot.txt も書かない。
そんな放置スタイルだけど意外と見る人いるんだなー。

で、サブタイのキーワードで検索されてたんだけど、
バッチの終了時って、何もしなくてDOS窓消えるんじゃ無いっけ?
プロセスが残るようなアプリを起動したら
消えないだろうけど

つまり、バッチに notepad.exe だけ書いてバッチからメモ帳を起動すると
メモ帳が閉じるまでDOS窓も消えない。

この場合は、例えばバッチへのショートカットを作って、
そのショートカットのプロパティで最小化して実行を設定するとか
(これはDOS窓が最小化されて実行されるだけね)
他には、バッチの中身を
start /B notepad.exe
とかにすればいいっぽいよ

[murmur] キクラゲ

このサイト、キクラゲで検索されてるんだけど 笑
国内のものは、ほとんど中国産で
中国産はこんな感じ なので、
外食でキクラゲが出たら残すくらいの勢いで。

どうしても食べるなら、国産にしたらいいと思う

[Windows Mobile 6] メールの情報を取得する

で、さらにこんなメソッドを作って
メッセージの本文まで取ろうとしたら
PR_SUBJECT しか返ってこないぞ、ってのが
前回までの話

void CheckMail()
{
    const SizedSSortOrderSet(1, sortOrderSet) = { 1, 0, 0, { PR_MESSAGE_DELIVERY_TIME, TABLE_SORT_DESCEND } };
    const SizedSPropTagArray (4, spta) = { 4, PR_SUBJECT, PR_BODY, PR_BODY_HTML, PR_CE_MIME_TEXT };

    CComPtr pSession;
    CComPtr pFolder;
    CComPtr ptbl;
    ULONG ulObjType = 0;
    ULONG cbEntryId = 0;
    LPENTRYID pEntryId;
    SRowSet *prowset;
    HRESULT hr;

    CComPtr pStore = GetMsgStore();
    
    hr = MAPIInitialize(NULL);
    hr = MAPILogonEx(0, NULL, NULL, 0, (LPMAPISESSION *)&pSession);
    hr = pStore->GetReceiveFolder(NULL, MAPI_UNICODE, &cbEntryId, &pEntryId, NULL);
    hr = pStore->OpenEntry(cbEntryId, pEntryId, NULL, 0, &ulObjType, (LPUNKNOWN*)&pFolder);
    hr = pFolder->GetContentsTable(0, &ptbl);
    hr = ptbl->SortTable((SSortOrderSet *)&sortOrderSet, 0);
    hr = ptbl->SetColumns ((SPropTagArray *) &spta, 0);

    while ( TRUE ) {
        hr = ptbl->QueryRows (1, 0, &prowset);

        if ((hr != S_OK) || (prowset == NULL) || (prowset->cRows == 0)) {
            break;
        }

        ASSERT (prowset->aRow[0].cValues == spta.cValues);
        SPropValue *pval = prowset->aRow[0].lpProps;

        if( pval[0].ulPropTag == PR_SUBJECT )
        TRACE( pval[0].Value.lpszW );
        if( pval[1].ulPropTag == PR_BODY )
        TRACE( pval[1].Value.lpszW );
        if( pval[2].ulPropTag == PR_BODY_HTML )
        TRACE( pval[2].Value.lpszW );
        if( pval[3].ulPropTag == PR_CE_MIME_TEXT )
        TRACE( pval[3].Value.lpszW );

    FreeProws( prowset );
    }

    MAPIUninitialize();
    hr = pSession->Logoff( NULL, NULL, 0 );
}

[Windows Mobile 6] メッセージの情報を取得

IMessage を使うみたい。
これはどうやって取得するんだろう

IMsgStore::OpenEntry()でとれる?

本日のツッコミ(全654件) [ツッコミを入れる]

Before...

_ Petronela [All greetings! Your site has very much liked me. springs I..]

_ Franciszek [Hi! Keep up the good work! springs Its very well ! http:/..]

_ Regina [This is a cool site! as a mere spectator? Gripping website..]

本日のリンク元 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

2007/07/30

[数学] 組み合わせって

組み合わせnCrって、順列を順列で割ってるんだね。
n個からr個とる組み合わせって、
まずはn個からr個とる順列を出して
「順番を関係なくするために」
順番が何通りあるかを出して、それで割ってやればいい。

r個からr個とる順列はrPr=r!だから
nCr=nPr÷rPr=nPr÷r!

なんでこんなこと書いたかというと
なんとなく頭に浮かんだからで、
こんなの教科書に載ってる話なんだけど

でもプログラムの世界では
「教科書に載っていることを書いても怒られない」

これは、教科書が少ないのと
教科書に載ってるような当たり前のことでも知らない人が多い
(ポインタの概念とか)
という理由があると思う。無理やり絡めてみたけど

[数学] 組み合わせって…その2

公式が直感的になってない
プレインなテキストで公式かけないので
文章で書くと(もうこの時点で数倍分かりづらくなるけど)
まずは順列から出すけど
nの階乗÷(n−r)の階乗
…うーん?
「n個からr個とりだして並べた場合の数はnの階乗÷(n−r)の階乗です」

n個のものを1個だけ選ぶ組み合わせはn通りだ
2個目を選ぶときは、1個へってるからn−1通りだ
これをr回繰り返せば
n個のものからr個選んで並べた場合の数は
(n)x(n−1)…
で、括弧がr個並ぶことになる

って説明されると分かるんだけどね

階乗の表が提供されてる問題ならともかくね。

組み合わせの場合は、並べ方の数をキャンセルするため
r個の並べ方の数(r!)で割るだけ

で、このいやーな説明のしづらさって、
nからrまで範囲を限定した階乗の表現が
存在しないからじゃないかと思う。

nからrまでの階乗=n!÷(n−r)!
5から3までの階乗=5!÷(5−3)!
これイヤじゃない?

5から3までの階乗=5x4x3
の方が直感的
(5〜3)!
みたいな表現が欲しいんだよね

あるのかも。例によって詳しい人教えてください。

[政治]政治って

政治って国のOSみたいなもんだから、
選挙行かない技術者って信用できない

技術者って面倒くさがりで怠惰で
効率のいいサボり方を常に模索してるはずでしょう

どんな新技術を生み出すより、
選挙で技術者優遇の流れに持っていくほうが
ずっと効率がいいのに

[政治] セクシャルマイノリティと政治

今更こんなこと書いても後出しになるけど、
セクシャルマイノリティを前面に押し出して立候補って
良くなかったと思う

セクシャルマイノリティでも
普通に政治家になれるって証明したいなら
最初にカミングアウトした後は、それを前面に出したりせず
あとは地道に選挙活動すればよかったんだよ

セクシャルマイノリティを武器に戦えるなんてこと
証明してどうするのさ

彼・彼女らが望んでいるのは、
あくまで、普通のことが当たり前にできることの証明でしょ

[murmur] GetPrivateProfileString

iniファイルを読み込むのに、
こんな便利な関数があったんだ。

char buf[32];
::GetPrivateProfileString(
    "MyData", // セクション名
    "MyFlag", // キー名
    "off", // 無かった場合のデフォルト値
    buf, // 値の格納先
    sizeof(buf) // 格納先のサイズ
    "MyFile.ini" // INIファイル名
);

で、MyFile.ini に
[MyData]
MyFlag = on
ってしておけば、
buf に "on" が入るし、該当するデータが無ければ
自動で "off" が入る。便利だなー。

[Windows Mobile 6] 受信メールのPR_BODYの取得

やっぱり IMessage を介して、さらに
IStream を使わないと駄目みたい。
動作確認はエミュのみ。
{

CComPtr<IMAPIFolder> pFolder;
CComPtr<IMAPITable> ptbl;
CComPtr<IMsgStore> pStore = GetMsgStore();
ULONG ulObjType = 0;
ULONG cbEntryId = 0;
LPENTRYID pEntryId;

hr = MAPIInitialize(NULL);
hr = MAPILogonEx(0, NULL, NULL, 0, (LPMAPISESSION *)&pSession);
hr = pStore->GetReceiveFolder(NULL, MAPI_UNICODE, &cbEntryId, &pEntryId, NULL);
hr = pStore->OpenEntry(cbEntryId, pEntryId, NULL, 0, &ulObjType, (LPUNKNOWN*)&pFolder);
hr = pFolder->GetContentsTable(0, &ptbl);

const SizedSPropTagArray (1, spta) = { 1, PR_ENTRYID };
hr = ptbl->SetColumns ((SPropTagArray *) &spta, 0);

while ( TRUE ) {
  hr = ptbl->QueryRows (1, 0, &prowset);

  if ((hr != S_OK) || (prowset == NULL) || (prowset->cRows == 0)) {
    break;
  }

  ASSERT ( prowset->aRow[0].cValues == spta.cValues );
  SPropValue *pval = prowset->aRow[0].lpProps;

  if ( pval[0].ulPropTag == PR_ENTRYID ) {
    IMessage* lpMessage;

    hr = pFolder->OpenEntry(
      pval->Value.bin.cb,
      (LPENTRYID)pval->Value.bin.lpb,
      NULL,//default interface
      MAPI_BEST_ACCESS,
      &ulObjType,
      (LPUNKNOWN *) &lpMessage );

    char szBuf[ 255 ];
    ULONG ulNumChars;
    IStream* lpStream;

    hr = lpMessage->OpenProperty(
      PR_BODY,
      &IID_IStream,
      STGM_READ,
      NULL,
      (LPUNKNOWN *) &lpStream);

    lpStream->Read( szBuf, 255, &ulNumChars );

    if ( lpStream != NULL ) {
     lpStream->Release();
    }

    if ( lpMessage != NULL ) {
      lpMessage->Release();
    }
  }
  FreeProws( prowset );
}

MAPIUninitialize();
hr = pSession->Logoff( NULL, NULL, 0 );

}

[murmur] Dear Altavista user

I found the link from Altavista's translation site.
If you have any questions about this site, I can answer in English.

Please post your comment from the link bottom-left of each section.
You can see the link to http://bibibi.info/url_of_section#c
and that is link for comment CGI.

Fill the form and then click the button to post.

Regards,
yoruno_d Webmaster of this site

本日のツッコミ(全3件) [ツッコミを入れる]

_ Monika_Brunou [I found this site again! Thanks. <a href="http://pamella...]

_ Rock [Hello, Admin! I just recently found out about Marshalspost..]

_ Antonina [hey everyone! Happy Landings Hey & Jackie, Well I thought ..]

本日のリンク元 | 6 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 |

2007/07/31

[数学] 平行四辺形

平行四辺形は、少なくとも、次の性質を持つ。

2組の対辺が、それぞれ等しい。
2組の対角が、それぞれ等しい。
対角線は、それぞれの中点で交わる。
2組の対辺は、それぞれ平行である。

また、上の性質のうち、どれか1つ以上満たすならば
それは平行四辺形である。

つまり、上の4つの性質のうちどれか1つを満たせば
残りの3つが成り立つということ。

平行四辺形が持つ性質は強力なので、
三角形の証明問題が出たら、 とりあえず平行四辺形にしてみるのも1つの手だ。

[Windows Mobile 6] CListCtrl のレポート表示

MFCでリスト表示に複数の列を持たせたいとき
(つまり、エクセルのような表示をさせたいとき)は
CListCtrl のスタイルをレポートにする。

リソースエディタでListCtrlを配置して、
プロパティで View の項目にレポートを設定すればいい。

簡単な初期化のコードを載せると、
まず、適当なビューを作って
CListCtrl m_List;
をメンバにもたせて
(ここら辺の処理もリソースエディタからやる)

で、そのビューの OnInitialUpdate()あたりで

LV_COLUMN stColumn; // 列構造体
CString csHeader; // ヘッダ用の文字列

// 構造体を初期化
memset( &stColumn, 0, sizeof( LV_COLUMN ) );
// 横幅とラベルをセットするので、当該マスクをオンにしておく
stColumn.mask = LVCF_WIDTH | LVCF_TEXT;
stColumn.cx = 100; // 横幅

csHeader = _T("その1");
// 構造体のバッファに文字列セット
stColumn.pszText = csHeader.GetBuffer();
m_List.InsertColumn( 0, &stColumn );

csHeader = _T("その2");
stColumn.pszText = csHeader.GetBuffer();
m_List.InsertColumn( 1, &stColumn );

こんな感じで

[Windows Mobile 6] 複数列のリストにアイテムを追加

まずは、こうしてみる

LVITEMW stItem;
CString csItem;
memset( &stItem, 0, sizeof(LVITEMW) );

stItem.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM;

// 1列目
csItem = _T("アイテム1");
stItem.pszText = csItem.GetBuffer();

stItem.iItem = 0; // 1行目
stItem.iSubItem = 0; // 1列目

m_List.InsertItem( &stItem ); // 1列目は InsertItem()

// 2列目
csItem = _T("アイテム2");
stItem.pszText = csItem.GetBuffer();

stItem.iItem = 0; // 1行目
stItem.iSubItem = 1; // 2列目

m_List.SetItem( &stItem ); // 2列目からは SetItem()

結果:
SetItem が 0 を返すのに、2列目が表示に反映されない…。
m_List.SetItem を
m_List.SetItemText( 0, 1, _T("アイテム2") );
に変えたら2列目の表示も反映されたけど
納得いかないなー。

本日のリンク元 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |