[не eVB] pwi

Обсуждение проблем, возникающих при разработке программ для мобильных устройств.
tyomitch
Пользователь #1352
Пользователь #1352
Аватара пользователя
 
Сообщения: 12822
Зарегистрирован: 20.10.2002 (Вс) 17:02
Откуда: חיפה

[не eVB] pwi

Сообщение tyomitch » 20.03.2005 (Вс) 20:11

А чем можно смотреть/редактировать .pwi-файлы (которые создаёт Notes)? Или хотя бы какой там формат?
Как-то я провёл весь вечер в гугле, но так ничего и не нашёл. Сейчас захотелось вновь... Может, у кого есть какая инфа об их устройстве?
Изображение

Amed
Алфизик
Алфизик
 
Сообщения: 5346
Зарегистрирован: 09.03.2003 (Вс) 9:26

Сообщение Amed » 20.03.2005 (Вс) 20:27

[off]Notes - это что? :? Текстовый редактор для наладонника?[/off]

hCORe
VB - Экстремал
VB - Экстремал
Аватара пользователя
 
Сообщения: 2332
Зарегистрирован: 22.02.2003 (Сб) 15:21
Откуда: parent directory

Сообщение hCORe » 20.03.2005 (Вс) 21:47

Нет - то же самое, что и "Заметки" в Outlook, но для PPC. И без форматирования. Но - с возможностью вставки голоса.

А насколько я помню, .pwi - это немного специфичный юникодный RTF с заголовком "pwi{" или похожим. Его вообще-то MS Word должен читать, если конвертеры установлены.
Моду создают модоки, а распространяют модозвоны.

Amed
Алфизик
Алфизик
 
Сообщения: 5346
Зарегистрирован: 09.03.2003 (Вс) 9:26

Сообщение Amed » 20.03.2005 (Вс) 23:16

wotsit.org пишет про документы wordpad... Но что-то мне кажется, что кто-кто, а tyomitch пепвым делом попёрся именно на wotsit.org... Интересно, интересно... Думаем дальше...

tyomitch
Пользователь #1352
Пользователь #1352
Аватара пользователя
 
Сообщения: 12822
Зарегистрирован: 20.10.2002 (Вс) 17:02
Откуда: חיפה

Сообщение tyomitch » 21.03.2005 (Пн) 0:27

При чём здесь документы WordPad? :-? ;-)

Word2003 SP1 якобы читает pwi, но у меня его нет :-(

И это не просто "специфичный RTF": он может содержать текст, рисунки от руки, картинки, звук - и всё это одновременно. И как это им только удаётся?
Изображение

Snussi
Продвинутый пользователь
Продвинутый пользователь
Аватара пользователя
 
Сообщения: 151
Зарегистрирован: 21.07.2004 (Ср) 18:08
Откуда: Москва, Россия

Сообщение Snussi » 21.03.2005 (Пн) 10:19

Статья из MSDN как конвертнуть PWI в RTF

Appendix: Converting RichInk PWI Data
The following pages describe a process for converting the RichInk data found in .pwi (Pocket Word Ink) files to RTF or Text formats. These instructions are intended for knowledgeable Windows programmers who are familiar with the messaging architecture in Windows.

Preliminary notes
The RichInk DLL is installed on the desktop with the Windows CE Services and exists in ROM on Windows CE devices. The RichInk.dll can be used for converting from the RichInk internal format (.pwi files) to either .rtf or text file formats.
On the desktop, ink data containing ink strokes is converted to RTF metafile data. This technique is not currently supported on the device, so data converted on the device will lose all non-text ink data.
If you want to use RichInk technology to convert files on the desktop, use InkEng.dll (found in the ActiveSync folder) rather than RichInk.dll. InkEng.dll maintains the same interfaces for EM_STREAMIN and EM_STREAMOUT as the device uses.
Conversion process

// Defines and typedefs needed for the conversion:
#define EM_STREAMIN (WM_USER + 73)
#define EM_STREAMOUT (WM_USER + 74)
typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)
(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
typedef struct _editstream
{
DWORD dwCookie; /* user value passed to callback as first parameter */
DWORD dwError; /* last error */
EDITSTREAMCALLBACK pfnCallback;
} EDITSTREAM;
typedef struct tagCOOKIE
{
HANDLE hFile;
LPBYTE pbStart;
LPBYTE pbCur;
LONG bCount;
DWORD dwError;
} COOKIE, * PCOOKIE;
// Stream formats:
#define SF_TEXT 0x0001
#define SF_RTF 0x0002
#define SF_UNICODE 0x0010 // Unicode data of some kind
#define SF_UTEXT SF_TEXT | SF_UNICODE // Unicode text file
#define SFF_PWI 0x0800
#define SF_PWI ( SF_RTF | SFF_PWI | 0x010000 ) // PWI format
The first step is to load the RichInk DLL:

HINSTANCE hLib;
hLib = LoadLibrary( TEXT(“richink.dll” ) );
if (!hLib)
return ERROR;
The next step is to create a RichInk window:

HWND hwndInk = NULL;
hwndInk = CreateWindow(“richink”, ES_READONLY, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, NULL, 0, NULL, NULL);
if (!hwndInk)
return ERROR;
With the RichInk window we can send EM_STREAMIN and EM_STREAMOUT messages in a manner very similar to the RichEdit desktop control:

EDITSTREAM es;
COOKIE cookie;
// Stream in the Ink Data from a memory block.
memset(&cookie, 0, sizeof(cookie));
cookie.dwError = 0;
cookie.pbStart = (LPBYTE)pb; // Pointer to memory block
cookie.pbCur = cookie.pbStart;
cookie.bCount = cb; // Size of ink data
es.dwCookie = (DWORD)&cookie;
es.dwError = 0;
es.pfnCallback = BufferReadCallback;
lResult = SendMessage (hwndInk, EM_STREAMIN, (WPARAM)SF_PWI, (LPARAM)&es);
// Next call stream out to get the size of the Unicode text.
cookie.dwError = 0;
cookie.pbStart = 0;
cookie.pbCur = 0;
cookie.bCount = 0;
es.dwCookie = (DWORD)&cookie;
es.dwError = 0;
es.pfnCallback = BufferWriteCallback;
lResult = SendMessage (hwndInk, EM_STREAMOUT, (WPARAM)SF_UTEXT, (LPARAM)&es);
// Allocate memory and stream out the Unicode text to it.
sz = (LPWSTR)LocalAlloc(LPTR, (cbSz = Cookie.pbCur - Cookie.pbStart) + 2);
// Check for alloc err.
cookie.dwError = 0;
cookie.pbStart = (LPBYTE)sz;
cookie.pbCur = cookie.pbStart;
cookie.bCount = cbSz;
es.dwCookie = (DWORD)&cookie;
es.dwError = 0;
es.pfnCallback = BufferWriteCallback;
lResult = SendMessage (hwndInk, EM_STREAMOUT, (WPARAM)SF_UTEXT, (LPARAM)&es);
Now finally some sample Callback functions:

static DWORD CALLBACK
BufferReadCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
PCOOKIE pCookie = (PCOOKIE)dwCookie;
LONG bytesLeft;
LONG bytesRead;
// Calc the bytes read.
bytesRead = pCookie->pbCur - pCookie->pbStart;
// Calc bytes left to read.
if (bytesRead < pCookie->bCount)
{
// Calc the bytes left to read.
bytesLeft = pCookie->bCount - bytesRead;
}
else
{
bytesLeft = 0;
}
// Don’t read past the end of buffer.
if (cb > bytesLeft) cb = bytesLeft;
// Set bytes read.
*pcb = cb;
// Copy any bytes.
if (cb)
{
memcpy(pbBuff, pCookie->pbCur, cb);
pCookie->pbCur += cb;
}
// Return no error.
return 0;
} // BufferReadCallback()
static DWORD CALLBACK
BufferWriteCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
PCOOKIE pCookie = (PCOOKIE)dwCookie;
PCOOKIE pCookie = (PCOOKIE)dwCookie;
// Do not overwrite the end of the buffer.
// If there is no output buffer, then we’re
// only here to determine the space required
// for the stream out.
If (pCookie->pbStart &&
(pCookie->pbCur + cb > pCookie->pbStart + pCookie->bCount))
{
// Writing all this data would overflow the buffer.
// So only write what will fit.
cb = pCookie->pbStart + pCookie->bCount - pCookie->pbCur;
}
*pcb = cb;
if (pCookie->pbStart)
memcpy(pCookie->pbCur, pbBuff, cb); pCookie->pbCur += cb;
return 0;
} // BufferWriteCallback()
The foregoing example streams out Unicode text, but could be used to stream out RTF or ANSI text by changing the Stream Format to SF_RTF or SF_TEXT. By changing the callback functions, data can be read from and/or written to a file.

Sample callback functions for reading/writing
Here are some sample callback functions for file reading and writing:

static DWORD CALLBACK
ReadCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
PCOOKIE pCookie = (PCOOKIE)dwCookie;
// Zero the bytes read.
*pcb = 0;
// If there is an error return it.
if (ReadFile(pCookie->hFile, pbBuff, cb, pcb, 0) == 0)
return (pCookie->dwError = GetLastError());
// Return no error.
return 0;
} // ReadCallback()

static DWORD CALLBACK
WriteCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
PCOOKIE pCookie = (PCOOKIE)dwCookie;
if (WriteFile(pCookie->hFile, pbBuff, cb, pcb, 0) == 0)
return (pCookie->dwError = GetLastError());
return 0;
} // WriteCallback()
Compatibility issues
The previous code describes the interface for desktop Windows CE Services 2.2. This interface is also the same for Handheld PC 2.11 and Palm-sized PC 1.2 devices. For previous versions of Windows CE Services or for HPC 2.0 or Palm-size PC 1.0 devices, the following change must be made:

Earlier versions passed a pointer to a variable containing the Stream Format rather than just the Stream Format constant directly. For example:
DWORDwpSF = SF_PWI;

SendMessage (hwndInk, EM_STREAMIN, (WPARAM)&wpSF, (LPARAM)&es);

Earlier versions may also require the use of the following constant when writing Unicode text files:
#define SF_UTEXT 0x0005

EN
Начинающий
Начинающий
 
Сообщения: 1
Зарегистрирован: 19.11.2006 (Вс) 12:18

Помогите с pwi

Сообщение EN » 19.11.2006 (Вс) 12:22

Пишу в заметках текст и звук. Перегоняю в ноутбук, но Word открывает только текст, рисунки, и не видит звукового файла.
Возможно ли его как-то там открыть? :roll:


Вернуться в Visual Basic для мобильных устройств

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 7

    TopList