Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Possible to Call External Program from VFP MTDLL?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01138193
Message ID:
01138674
Views:
13
Yep, it's been a good learning experience. Here's a quick and dirty example.


*--Main Class
DEFINE CLASS myclass AS session OLEPUBLIC

PROCEDURE MaxOutCPU AS VOID
*--Count to Half a billion.
lnStart = SECONDS()
FOR i = 1 TO 500000000
NEXT i
=STRTOFILE("Process Took: " + TRANSFORM(SECONDS() - lnStart) + " seconds" + CHR(13) + CHR(10), "C:\FoxStats.txt",1)
ENDPROC

PROCEDURE CallExternal(cExternal as String) &&--Must contain UNC path and file name.
DO (cExternal)
=STRTOFILE("Ran external Func: " + TRANSFORM(DATETIME()) + CHR(13) + CHR(10), "C:\FoxStats.txt",1)
ENDPROC

ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform