smartphone "windows mobile 6.5" "native C++" MVS 2008
Posted by Libor in Other Languages
27-Aug-10 09:43 AM
Hello, I'm having problem with any read/write operation in an app I'm doing for my Samsung Omnia 8000 phone.
I'm using Microsoft Visual Studio 2008, -> project template "C++" ->Smartphones.
I'm using below code. It also does not work.:
HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile(_T("\\test.txt"),GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
FlushFileBuffers(hFile);
CloseHandle(hFile);
On PPC, it just pretends to work, ( wmWritten is set properly ). Nevertheless, the file is not writen to my phone, niether it is written to the shared folder in MVS 2008 PPC emulator.
The code
FILE *fs = fopen("protocol.txt", "a");
fprintf(fs, "end of execution\n");
fclose(fs);
When a similar project for PC is created, it works well. The same apply for ReadFile(). Things like dialogs etc. work in a project for my PPC without any difficulties.
I must be missing something fundamental but I cann't find what it is.
Programming in CompactFramework environment seems to work fine, icl. I/O operation. But my old PDA does not have .net support...
Thanks for help. Libor