Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call VFP .exe and library from C#
Message
De
31/03/2003 16:00:02
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Visual FoxPro Toolkit pour .NET
Titre:
Call VFP .exe and library from C#
Divers
Thread ID:
00772152
Message ID:
00772152
Vues:
39
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
Fil
Voir

Click here to load this message in the networking platform