Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell's SHFileOperation

Status
Not open for further replies.

vfpshe

Programmer
Jan 2, 2001
24
0
0
US
Can somebody please please help me with this function. I've been trying to use this function to copy folders from one location to another. I was thinking of using this because of the animated progress bar and status info. it provides while copying.

Here's part of my code:

Declare INTEGER SHFileOperation IN Shell32.dll SHFILEOPSTRUCT

PUBLIC oFileStruct
oFileStruct = CREATEOBJECT([SHFILEOPSTRUCT])

WITH oFileStruct
.hwnd = Thisform.HWnd
.wFunc = 0x2 &&[fo_copy]
.pfrom = [c:\dummy\*.*]
.pTo = [c:\documents\dummy]
.fFlags = 0x100
ENDWITH

=SHFileOperation(oFileStruct)

DEFINE CLASS SHFILEOPSTRUCT AS Custom
hwnd = 0
wFunc = 0
pFrom = ''
pTo = ''
fFlags = 0
fAnyOperationsAborted = 0
hNameMappings = 0
lpszProgressTitle = ''
ENDDEFINE

~~~~~~~~~~~~~~~~~~~

This just doesn't seem to work.. it give me a 'too many argument' message.. please help!

-vfpshe
 
VFP doesn't support &quot;structures&quot; for API calls directly, so you will need to build a string that &quot;looks&quot; like the structure to this DLL. While you can do this manually <s>, you may be better off getting a class that can do this for you. Go to the UT ( click on the Download picture on the leftt, and choose the Visual FoxPro area. Next enter 'struct' (without the quotes) in the Title area and press Enter. You should get back an entry for:
struct.zip - &quot;A Visual FoxPro class to simplify packing and unpacking of structures for use WINAPI functions or other DLLs Code is included.&quot;
There is excellent documentation on it's use in a .DOC file.

Rick
 
thanks so much rick!

i almost gave up but after using the struct.vcx, it gave me hope to using windows api.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top