Information générale
Catégorie:
Visual FoxPro Toolkit pour .NET
Titre:
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!!
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement