Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro and Win2000
Message
From
05/12/2000 02:21:07
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00446642
Message ID:
00449203
Views:
14
I Have an idea for you involving the use of a small piece of code to dig through a project and try to force a rewrite of component files:
FUNCTION ForceFlushEndWithT
IF ! 'CLSHEAP'$UPPER(SET('PROCEDURE'))
   SET PROCEDURE TO ClsHeap ADDITIVE
ENDIF
CLOSE ALL
DECLARE INTEGER GetActiveWindow IN WIN32API
DECLARE INTEGER SHFileOperation IN SHELL32.DLL STRING @ LPSHFILEOPSTRUCT
SET PROCEDURE TO CLSHEAP ADDITIVE
oHeap = CREATEOBJ('Heap')
cSource = FULLPATH(CURDIR())
cDest = cSource + SYS(2015) + '\'
MKDIR (cDest)
#DEFINE FO_COPY 2
#DEFINE FO_DELETE 3
#DEFINE FOF_NOCONFIRMATION 0x10    &&  Don't prompt the user.
#DEFINE FOF_NOCONFIRMMKDIR 0x200   &&  don't confirm making any needed dirs
#DEFINE FOF_ALLOWUNDO 0x40         &&  permit undo action
cSourceString = cSource + '.??T' + CHR(0) + CHR(0)
cDestString = cDest + CHR(0) + CHR(0)
nStringBase = oHeap.AllocBlob(cSourceString+cDestString)
cFileOpStruct = NumToDWORD(GetActiveWindow()) + ;
                NumToDWORD(FO_COPY) + ;
                NumToDWORD(nStringBase) + ;
                NumToDWORD(nStringBase + LEN(cSourceString)) + ;
                NumToDWORD(FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR) + ;
                CHR(0) + ;
                NumToDWORD(0) + ;
                NumToDWORD(0)
=SHFileOperation(cFileOpStruct)
cSourceString = cDest + '.??T' + CHR(0) + CHR(0)
cDestString = cSource + CHR(0) + CHR(0)
nStringBase = oHeap.AllocBlob(cSourceString+cDestString)
cFileOpStruct = NumToDWORD(GetActiveWindow()) + ;
                NumToDWORD(FO_COPY) + ;
                NumToDWORD(nStringBase) + ;
                NumToDWORD(nStringBase + LEN(cSourceString)) + ;
                NumToDWORD(FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR + FOF_ALLOWUNDO) + ;
                CHR(0) + ;
                NumToDWORD(0) + ;
                NumToDWORD(0)
=SHFileOperation(cFileOpStruct)
cSourceString = cDest + '.??T' + CHR(0) + CHR(0)
cDestString = CHR(0) + CHR(0)
nStringBase = oHeap.AllocBlob(cSourceString+cDestString)
cFileOpStruct = NumToDWORD(GetActiveWindow()) + ;
                NumToDWORD(FO_DELETE) + ;
                NumToDWORD(nStringBase) + ;
                NumToDWORD(nStringBase + LEN(cSourceString)) + ;
                NumToDWORD(FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR + FOF_ALLOWUNDO) + ;
                CHR(0) + ;
                NumToDWORD(0) + ;
                NumToDWORD(0)
=SHFileOperation(cFileOpStruct)
RMDIR (cDest)
oHeap = ''
RETURN
I'm not guarenteeing error checking to prevent dumb naming errors, or that you have enough disk space or anything of that type; this is strictly a kludge I've put together that will bulk copy, recopy, delete the temp and remove the temp dir. Anyone who wants to bitch is welcome to go play in traffic; I don't need the bullshit. It works reasonably safely, and if it's a matter of copying and saving, it might help.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform