Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use SHFileOperation function in VFP6
Message
From
12/10/2002 10:00:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00639817
Message ID:
00710624
Views:
28
>>>>Ed,
>>>>I created a FLL for SHFileOperation. Though it generally succeeds, rarely it returns 'Cannot read from device' (1026?) error under XP (and .NET Release version installed). Retrying succeeds if done with a short delay. In many trials I couldn't make it to work consistently. Directly using CopyFile,MoveFile etc API it never fails (provided same access rights etc). It was working w/o failure under w2k and w9x (no .NET).
>>>>I'll try to send the source to you hoping you can catch something I missed :)
>>>>Best regards
>>>
>>>Cetin,
>>>
>>>The function is supported by Shell32 4.0 and later. I've got a feeling (and it's just that) that it may be because of additional files needed to support the localized version of Windows (read Unicode).
>>
>>George,
>>I use the same localization info fo both w2k and xp. I have at least Shell32 4.0 in both. It was working under w2k, since upgraded to xp it fails intermittently. It works if you have a 'brief' pause before a second try.
>
>Cetin,
>
>SWAG here. Have you tried adding a call to Sleep() prior to the first call? If I had to hazard a guess, it sounds like some sort of timing problem.

No honestly I didn't :) I didn't because I don't have an explanation why it'd fail sometimes after long idle times. It doesn't fail with a consistent pattern so lost my trust. I already created my own version using winAPI and it works very well, I don't think I'd ever want to use again SHFileOperation:)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform