Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
* Author: William GC Steinford
* Date: June 26, 2003
* Code to write a text file on device:
hnd=CeCreateFile('Storage Card\My Documents\Text\test.txt')
?hnd
if hnd<>-1
?cewritefile(hnd,"Hello Windows CE!!")
?ceCloseHandle(hnd)
endif
* Api function wrappers follow:
FUNCTION CeCreateFile( pcName )
DECLARE LONG CeCreateFile IN RAPI.DLL AS _ceCreateFile ;
STRING @ LPCTSTR_lpFileName, ;
LONG DWORD_dwDesiredAccess, ;
LONG DWORD_dwShareMode, ;
LONG Ignored_LPSECURITY_ATTRIBUTES_lpSecurityAttributes, ;
LONG DWORD_dwCreationDispostion, ;
LONG DWORD_dwFlagsAndAttributes, ;
LONG Ignored_HANDLE_hTemplateFile
LOCAL lnHnd, lcStr
lcStr = StringToUnicode(pcName)
lnHnd = _ceCreateFile( @lcStr, BitOr(GENERIC_READ,GENERIC_WRITE), ;
0,0,CREATE_ALWAYS,0,0 )
RETURN lnHnd
ENDFUNC
FUNCTION CeCloseHandle( pnHnd )
DECLARE LONG CeCloseHandle IN RAPI.DLL AS _ceCloseHandle ;
LONG nHnd
RETURN _ceCloseHandle(pnHnd)=1
ENDFUNC
FUNCTION CeWriteFile( pnHnd, pcStr )
DECLARE LONG CeWriteFile IN RAPI.DLL AS _ceWriteFile ;
LONG HANDLE_hFile, ;
STRING @ LPCVOID_lpBuffer, ;
LONG DWORD_nNumberOfBytesToWrite, ;
LONG @ LPDWORD_lpNumberOfBytesWritten, ;
LONG Ignored_LPOVERLAPPED_lpOverlapped
LOCAL lnWritten
lnWritten = 0
_ceWriteFile( pnHnd, @pcStr, len(pcStr), @lnWritten, 0 )
RETURN lnWritten
ENDFUNC
PROCEDURE UnicodeToString( pcStr )
LOCAL lcSkel
lcSkel = StrConv( pcStr, 6 ) && Double Byte <- Unicode
lcSkel = StrConv( lcSkel, 2 ) && Single byte <- Double Byte
RETURN LEFT(lcSkel, MAX(AT(chr(0),lcSkel)-1,0) )
ENDPROC
PROCEDURE StringToUnicode( pcStr )
LOCAL lcSkel
lcSkel = StrConv( pcStr, 1 ) && Single byte -> Double Byte
lcSkel = StrConv( lcSkel, 5 ) && Double Byte -> Unicode
RETURN lcSkel+chr(0)
ENDPROC