Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynaZip and VFP
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00592423
Message ID:
00593327
Vues:
34
Awesome, dude!

>Kevin,
>I'm surprised the Object Browser created this because it won't run. The Interface isn't created correctly. In order for VFP to recognize that the interface is being implemented, all methods associated with the interface must have the name prepended to it.
>
>The following code works (I actually ran it < s >):
>clear
>LOCAL oDynaZip as DZACTXLib.dzactxctrl, oHandler, lBound
>
>oDynaZip = CREATEOBJECT("dzactxctrl.dzactxctrl.1")
>oHandler = CREATEOBJECT("DzHandler")
>
>lBound = EVENTHANDLER(oDynaZip, oHandler)
>oDynaZip.ZIPFile = 'Dynaziptst.zip'
>oDynaZip.ItemList = curdir() + [*.txt]
>oDynaZip.MajorStatusFlag = .T.
>oDynaZip.ActionDZ = 4
>return
>
>DEFINE CLASS DzHandler AS Custom
>
>IMPLEMENTS _dzactxEvents IN {0E9D0E41-7AB8-11D1-9400-00A0248F2EF0}#1.0
>
>PROCEDURE _dzactxEvents_ZipMajorStatus(ItemName As String, Percent As Numeric, Cancel As Numeric) As None
>wait window transform(Percent) nowait
>ENDPROC
>
>PROCEDURE _dzactxEvents_ZipMemToMemCallback(lAction As Numeric, lpMemBuf As String, pdwSize As Numeric, dwTotalReadL As Numeric, ;
>   dwTotalReadH As Numeric, dwTotalWrittenL As Numeric, dwTotalWrittenH As Numeric, plRet As Numeric) As None
>*
>ENDPROC
>
>PROCEDURE _dzactxEvents_ZipMessageCallback(MsgID As Numeric, mbType As Numeric, p1 As Numeric, p2 As Numeric, sz1 As String, ;
>   sz2 As String, rc As Numeric) As None
>*
>ENDPROC
>
>PROCEDURE _dzactxEvents_ZipMinorStatus(ItemName As String, Percent As Numeric, Cancel As Numeric) As None
>*
>ENDPROC
>
>PROCEDURE _dzactxEvents_ZipRenameCallback(ItemName As String, iDate As Numeric, iTime As Numeric, lAttrib As Numeric, ;
>   OrigItemName As String, rc As Numeric) As None
>*
>ENDPROC
>
>ENDDEFINE
>
>Notice you have to set the MajorStatusFlag to .T. for it to execute the associated method.
>
>HTH.
>
>P.S. Thanks for asking the question. Now I have something I can add to my zip routine.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform