Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call VFP .exe and library from C#
Message
From
31/03/2003 16:00:02
 
 
To
All
General information
Forum:
ASP.NET
Category:
Visual FoxPro Toolkit for .NET
Title:
Call VFP .exe and library from C#
Miscellaneous
Thread ID:
00772152
Message ID:
00772152
Views:
38
I need to call a VFP6 .exe from C# (currently it's called from another VFP6 app).

The code is below, and I welcome, and will so appreciate, any suggestions on how to do it.


Current VFP 6.0 code that calls BookOut.exe:


LOCAL vp_AccountID, lcCurrentPath, loBookOut, lcLib, lcBookOut

vp_AccountID = THISFORM.AccountID


lcCurrentPath = CURDIR()

CHDIR r:

CHDIR (THIS.cBookOutPath)

lcLib = "aCustomBookOutdata"

SET CLASSLIB TO &lcLib IN BookOut.EXE ADDITIVE

loBookOut = CREATEOBJECT(lcLib)

IF TYPE("loBookOut") = "O"

WITH loBookOut

.iAccountid = vp_AccountID

.cRegion = "Texas"

DO BookOut.exe WITH loBookOut

IF .lSaveSelected = .T.

SELECT rv_AutoM

REPLACE rv_AutoM.cVIN WITH .cVIN,;

rv_AutoM.nYear WITH .iYear,;
rv_AutoM.cMake WITH .cMake,;
rv_AutoM.cModel WITH .cSeries,;
rv_AutoM.nMileage WITH .iMileage,;
rv_AutoM.nBookOutValue WITH .iAdjustedTrade,;
rv_AutoM.nInitialBookOutValue WITH .iAdjustedTrade

TABLEUPDATE(.T.)
SELECT rv_CustCall
REPLACE rv_CustCall.nequipmentadjustment WITH 0
TABLEUPDATE(.T.)

ENDIF
ENDWITHELSE

MESSAGEBOX("Cannot instantiate BookOut Account. Please contact the I.S. department.", 16, APP_NAME)

ENDIF

CHDIR c:
CHDIR (lcCurrentPath)
THISFORM.frmRefresh()

***************
Thank you!!
Next
Reply
Map
View

Click here to load this message in the networking platform