General information
Category:
Visual FoxPro Toolkit for .NET
Title:
Call VFP .exe and library from C#
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only