>I try to use zip32.dll to create zip file.
>There is a working VB 5 program which uses this dll
>(
http://www.modemss.brisnet.org.au/~mlevoi/infozip.zip )
>I need to convert it into VFP.
>Why the following program crashes? how to make it work.
>
>*Private Declare Function ZpArchive Lib "zip32.dll" _
>*(ByVal argc As Long, ByVal funame As String, ByRef argv As ZIPnames) As Long ' Real zipping action
>*' argc As Long 'number of files
>*' filename As String 'Name of the Zip file
>*' fileArray As ZIPnames 'The array of filenames
>
>declare long ZpArchive in zip32.dll ;
>long argc, string funame , string @ Zipnames
>
>* ' MYZCL.argc = 2
>* ' MYZCL.filename = "c:\wiz\new.zip"
>* ' MYZCL.fileArray = MYNAMES
>
>dime t[1]
>t[1]='c:\autoexec.bat'
>? ZpArchive( 2, 'test.zip', t ) && causes gpf
Simple answer - you can't pass a VFP array through the API interface. And you aren't bringing anything back across the interface since all your values are passed by value. The GPF is likely caused by a memory exception because the API call didn't understand where it could and could not write, and stomped VFP to death.