Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP50A - Automation Server Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00082447
Message ID:
00082878
Vues:
29
>I am trying to enable an portion of an exsisting application to be
>able to be called from other applications. I have had good luck with
>portions that did not require a user interface, but this current one
>(which has a user interface) isn't working. I can call it and it
>begins to process, then the form unloads and returns control to the
>calling application. The form being called (CPAT) from the PUBLIC
>Class is modal and for testing purposes I put a messagebox() in the
>Activate and Unload method. The messagebox() fired only in the unload
>method.
>
>I am compling the application as an EXE (Out-of-Process Server).
>
>I'm sure there is a "Classier" way of doing this, like saving the
>whole form as a class, but I'm attempting to do it with the least
>amount of writing. The following it the public class code that is
>called from outside application using the CreateObject command:
>
>DEFINE CLASS cpat as custom olepublic
> lc_PatId=''
> DataSession=1
> Patient = NULL
> ld_Date={ / / }
>
> PROCEDURE Init
> parameters tcdate
>
> DECLARE INTEGER GetPrivateProfileString IN Win32API AS ;
> GetPrivStr String cSection, String cKey, ;
> String cDefault, String @cBuffer, ;
> Integer nBufferSize, String cINIFile
>
> ENDPROC
>
>
> PROCEDURE Activate
> store " " to lcDefault,lc_Data,lc_Table
> set deleted on
> set excl off
> set safety off
> set talk off
> set echo off
> set century on
> public gc_INIFILE
> gc_INIFILE=[C:\WINDOWS\CTOR.INI]
> lcDefault=THIS.GetDatapath()
> lc_Data=lcDefault+[doc]
> lc_Table=lcDefault+[pat]
> ENDPROC
>
> PROCEDURE WPATEDIT && This is the Main Procedure
> PARAMETERS tcpatid
> LOCAL lcDefault,lc_Data,lc_Table,ll_Match
> lcDefault=THIS.GetDatapath()
> lc_Data=lcDefault+[doc]
> lc_Table=lcDefault+[pat]
> ll_Match=.f.
> OPEN DATA (lc_Data) SHARED
> DO FORM cPAT
> IF USED(''pat")
> USE
> ENDIF
> CLOSE DATABASES
> ENDPROC
>
>
> FUNCTION GetDataPath
> LCINIFILE=[C:\WINDOWS\CTOR.INI]
> lcBuffer = SPACE(35) + CHR(0)
>
> IF GetPrivStr("DEFAULTS", "Path", "", ;
> @lcBuffer, LEN(lcBuffer), ;
> LCINIFILE) > 0
>
>
> llError=.f.
> lcOldError=on('Error')
> ON ERROR llError = .T.
> lc_Path=alltrim(lcBuffer)
> lc_Path=transform(lc_Path,"")
> ON ERROR &lcOldError
> if llError
> wait [Error Occured] window
> return .f.
> endif
> ELSE
> return .f.
> ENDIF
> return (lc_Path)
>
>ENDDEFINE
>
>
>Thanks for any and all help/pointers/suggestions
>
>Kirk
>cqi_provider@email.msn.com


Kirk,

you can't have user input required in a OAS; I'd try removing the modal form.

Hank
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform