Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program does not execute when compiled into Exe program
Message
From
14/11/2016 16:42:02
 
 
To
12/11/2016 16:38:08
Sonny Tabano
Trams Printwork, Inc.
Mabalacat, Philippines
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01643256
Message ID:
01643438
Views:
72
some suggestions:
1-avoid macro substitution as pointed by Naomi
2.In general,if you createObject dont omit at the end to destroy it (oshell=null).in principe oshell declared as local does it.
3.if your exe works on win XP try to run it with compatibility on win7 (or upper)
4.this function is a scripting one.then scripting host must be mandatory installed on PC to run COM object shell application
5.in my personal experience with shell.application objects i avoid loops and work with
for each.....endfor &&often with zip/unzip

6. this is a working code on my Win10 , compiled as exe and tested successfully.
#define  FOF_CREATEPROGRESSDLG  0x0   &&this fires a windows progressaber for big contents 
ParentFolder = "E:\asup"
if !directory("e:\asup")  &&create folder asup if not exists
md e:\asup
endi
set defa to (m.Parentfolder)

local objShell
objShell = CreateObject("Shell.Application")
objFolder = objShell.NameSpace(ParentFolder)
objFolder.CopyHere ("C:\Users\yousfi\Pictures\*.jpg", FOF_CREATEPROGRESSDLG )    &&copy the jpg from win pictures folder to asup
objShell=null
run/n explorer &ParentFolder 
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform