I am writing because I am having a problem I wasn´t able to resolve.
I am using the SetFilePointer function in my mobile project. The problem arise when I try to test it in my emulator. The SetFilePointer function moves its pointer in the oposite direction. When I pass a positive value to the method, the file pointer moves backward. And when I pass it a negative one, it moves foward. This only happens when the dwMoveMethod it´s set to FILE_END.
When I run the program in my ppc it works fine, just like the documentation explain.
Maybe I am doing something wrong, does anybody have the same problem. I try to search in the forum and no post for SetFilePointer was found. Also, I not sure if this is the right forum to post.
My emulators are,
The windows ce emulator for pocket pc 2003 and the
Microsoft Device Emulator for WM2005
The file SOMETHING.zip it´s a 170 byte file. So I try this code, with 70 and with -300. The first one returns a pointer with 100 and the second a pointer with 470. I am adding some code.
I am using the SetFilePointer function in my mobile project. The problem arise when I try to test it in my emulator. The SetFilePointer function moves its pointer in the oposite direction. When I pass a positive value to the method, the file pointer moves backward. And when I pass it a negative one, it moves foward. This only happens when the dwMoveMethod it´s set to FILE_END.
When I run the program in my ppc it works fine, just like the documentation explain.
Maybe I am doing something wrong, does anybody have the same problem. I try to search in the forum and no post for SetFilePointer was found. Also, I not sure if this is the right forum to post.
My emulators are,
The windows ce emulator for pocket pc 2003 and the
Microsoft Device Emulator for WM2005
The file SOMETHING.zip it´s a 170 byte file. So I try this code, with 70 and with -300. The first one returns a pointer with 100 and the second a pointer with 470. I am adding some code.
- Code:
HANDLE mifile = CreateFile(TEXT("/STORAGE CARD/SOMETHING.zip"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
DWORD pointer = SetFilePointer(mifile, 70, NULL, FILE_END);