Wie muß ich das mit dem Buffer machen?MSDN hat geschrieben:LONG mmioWrite(HMMIO hmmio, char _huge* pch, LONG cch);
Parameters
hmmio
File handle of the file.
pch
Pointer to the buffer to be written to the file.
cch
Number of bytes to write to the file.
Return Values
Returns the number of bytes actually written. If there is an error writing to the file, the return value is -1.
Mein Code:
Code: Alles auswählen
; change_riff-tag.pb
Define main_lpck.MMCKINFO
Define info_lpck.MMCKINFO
Define Itag_lpck.MMCKINFO
Define Itag_buff.s =Space(1024)
Define write_buf.s =Space(1024)
Define filename.s = "NASA.avi"
;Filename.s = OpenFileRequester("","","AVI Files (*.avi)|*.avi",0)
If Filename
HMMIO = mmioOpen_(Filename,0,#MMIO_READWRITE)
; check FILE FORMAT
main_lpck\fccType = mmioStringToFOURCC_("AVI ",MMIO_TOUPPER)
Result = mmioDescend_(HMMIO,main_lpck,0,#MMIO_FINDRIFF)
If Result <> #MMSYSERR_NOERROR
Debug "Error: Not an AVI file!" : End
Else
Debug "Suxes: This is an AVI file!"
EndIf
; find in LIST named INFO
info_lpck\fccType= mmioStringToFOURCC_("INFO",MMIO_TOUPPER)
Result = mmioDescend_(HMMIO,info_lpck,0,#MMIO_FINDLIST)
If Result <> #MMSYSERR_NOERROR
Debug "Error: Couldn't get the LIST named INFO!"
Else
Debug "Suxes: Found the LIST named INFO"
EndIf
; find the existing chunk(tag) "INAM"
Itag_lpck\ckid = mmioStringToFOURCC_("INAM",MMIO_TOUPPER)
Result = mmioDescend_(HMMIO,Itag_lpck,info_lpck,#MMIO_FINDCHUNK)
If Result <> #MMSYSERR_NOERROR
Debug "Error: Couldn't get the CHUNK named INAM !"
Else
Debug "Suxes: Found the CHUNK named INAM"
EndIf
;Debug Itag_lpck\ckid
Debug ""
Debug "Itag_lpck\ckid = "+PeekS(@Itag_lpck\ckid,4)
Debug "Itag_lpck\cksize = "+Str(Itag_lpck\cksize)
;Debug Itag_lpck\fccType
Debug "Itag_lpck\fccType = "+PeekS(@Itag_lpck\fccType,4)
Debug "Itag_lpck\dwDataOffset= "+Str(Itag_lpck\dwDataOffset)
Debug "Itag_lpck\dwFlags = "+Str(Itag_lpck\dwFlags)
Debug ""
Debug "---------Try to change the contentes of INAM--------------"
write_buf = "changed by me"
Debug "write_buf = changed by me"
Debug "write_buflen = "+Str(Len(write_buf))
wr_result = mmioWrite_(HMMIO,*write_buf,Len(write_buf))
Debug wr_result
Itag_lpck\dwFlags = #MMIO_DIRTY
asc_result = mmioAscend_(HMMIO,Itag_lpck,0)
If asc_result = MMIOERR_CANNOTSEEK
Debug "MMIOERR_CANNOTSEEK: There was an error while seekingto the end of the Chunk"
ElseIf asc_result = MMIOERR_CANNOTWRITE
Debug "MMIOERR_CANNOTWRITE: The contents of the buffer could not be written to disk"
Else
Debug "unknown errorcode"
EndIf
mmioClose_(HMMIO,0)
EndIf
Was mach ich falsch?
mDv...
scholly