Metode IRealTimeStylus::GetDesiredPacketDescription (rtscom.h)

Mengambil daftar properti yang telah diminta untuk disertakan dalam aliran paket.

Sintaks

HRESULT GetDesiredPacketDescription(
  [in, out] ULONG *pcProperties,
  [out]     GUID  **ppPropertyGuids
);

Parameter

[in, out] pcProperties

Ukuran, dalam byte, dari buffer ppPropertyGUIDS .

[out] ppPropertyGuids

Pointer ke daftar GUID yang menentukan properti mana, seperti X, Y, dan NormalPressure, ada dalam data paket. Untuk daftar properti yang telah ditentukan sebelumnya, lihat PacketPropertyGuids Constants.

Mengembalikan nilai

Untuk deskripsi nilai yang dikembalikan, lihat Kelas dan Antarmuka RealTimeStylus.

Keterangan

Gunakan metode ini untuk mendapatkan array properti paket tempat objek IRealTimeStylus berlangganan dengan memanggil IRealTimeStylus::SetDesiredPacketDescription Method. Properti paket diwakili oleh array pengidentifikasi unik global (GUID). Untuk daftar lengkap properti yang dapat Anda ambil metriknya, lihat Konstanta PacketPropertyGuids.

Defaultnya adalah array GUID yang berisi GUID tekanan X, Y, dan normal.

Metode IRealTimeStylus::GetDesiredPacketDescription menggunakan CoTaskMemAlloc untuk mengalokasikan ruang untuk GUID. Pemanggil harus memanggil CoTaskMemFree ketika array tidak lagi diperlukan.

Jika dipanggil pada objek IRealTimeStylus anak (konfigurasi bertingkat) dan tersambung, metode ini mengembalikan deskripsi paket induk jika tersambung, jika tidak, metode ini mengembalikan default (X, Y, tekanan) atau properti apa pun yang diatur dalam panggilan sebelumnya ke Metode IRealTimeStylus::SetDesiredPacketDescription.

Daftar berikut menjelaskan bagaimana objek IRealTimeStylus memesan GUID properti paket.

  • Secara default, metode Metode IRealTimeStylus::GetDesiredPacketDescription mengembalikan GUID_X, GUID_Y, dan GUID_NORMAL_PRESSURE.
  • GUID X dan Y selalu dikembalikan dalam dua posisi pertama dalam array oleh metode Metode IRealTimeStylus::GetDesiredPacketDescription, apakah ditentukan dalam panggilan sebelumnya ke metode IRealTimeStylus::SetDesiredPacketDescription.
  • Jika GUID_PACKET_STATUS ditentukan dalam panggilan ke metode IRealTimeStylus::SetDesiredPacketDescription Method , GUID_PACKET_STATUS selalu dikembalikan di posisi terakhir dalam array oleh metode IRealTimeStylus::GetDesiredPacketDescription Method .
  • Jika ada GUID yang ditentukan lebih dari sekali dalam panggilan ke metode Metode IRealTimeStylus::SetDesiredPacketDescription , setiap GUID hanya terjadi sekali dalam array yang dikembalikan oleh metode IRealTimeStylus::GetDesiredPacketDescription Method .

Contoh

Kode contoh C++ berikut mendapatkan daftar properti yang disertakan dalam aliran paket.

GUID guidDesiredPacketDescription[] = { GUID_PACKETPROPERTY_GUID_X, 
                                        GUID_PACKETPROPERTY_GUID_Y, 
                                        GUID_PACKETPROPERTY_GUID_NORMAL_PRESSURE,
                                        GUID_PACKETPROPERTY_GUID_TANGENT_PRESSURE };

// Number of properties in the array
ULONG ulProperties = sizeof(guidDesiredPacketDescription) / sizeof(GUID);

// Set the packet information we'd like to get
if (SUCCEEDED(g_pRealTimeStylus->SetDesiredPacketDescription(ulProperties, guidDesiredPacketDescription)))
{
    TRACE("Set the desired packet description successfully.\n");
}

GUID* pGuids = NULL;

// See if setting the properties was successful
if (SUCCEEDED(g_pRealTimeStylus->GetDesiredPacketDescription(&ulProperties, &pGuids)))
{
    TRACE("The RealTimeStylus supports %d properties.\n", ulProperties);

    // Display the values of the GUIDs in debug output
    for (int i = 0; i < ulProperties; i++)
    {
        TRACE("GUID #%d == %d\n", i, pGuids[i]);
    }
}

Persyaratan

   
Klien minimum yang didukung Windows XP Tablet PC Edition [hanya aplikasi desktop]
Server minimum yang didukung Tidak ada yang didukung
Target Platform Windows
Header rtscom.h
DLL RTSCom.dll

Lihat juga

IRealTimeStylus

Metode IRealTimeStylus::SetDesiredPacketDescription

Kelas RealTimeStylus