Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Procedure In VFP exe?
Message
De
02/05/2013 12:21:35
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
02/05/2013 11:30:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01572452
Message ID:
01572492
Vues:
56
With all of your suggestions and responses I'm now completely baffled. So, I'm going to try to be as explicit as possible with this next attempt :) I'm trying to replicate what I think you are suggesting I do.

I've created a project called Testprocs. In it I have two programs in the "Code" tab as follows:

1) the main startup program is named "testprocsmain.prg" and has:

PROCEDURE setprocs
SET PROCEDURE TO testprocs.prg ADDITIVE
WAIT WINDOW NOWAIT "Procedures set..." TIMEOUT 4
ENDPROC

PROCEDURE sayit2
WAIT WINDOW TIMEOUT 4 "Sayit2 Procedure was called..."
ENDPROC

2) another program named "testprocs.prg" that has:

PROCEDURE sayit
WAIT WINDOW TIMEOUT 4 "Sayit Procedure was called..."
ENDPROC


I build the project as a "Win32 executable" named Testprocs.exe.

From the VFP command window, I try:

"DO setprocs IN Testprocs.exe" (without quotes), and the wait window appears indicating that the procedures are set.
Next I try "DO sayit IN Testprocs.exe" (without quotes) and VFP throws an error, "Procedure 'SAYIT' is not found."
Then if I type "DO sayit2 IN Testprocs.exe", a wait window appears from procedure Sayit2 which is defined in the top/main/startup whatever you want to call it.

Mike



>>If I define testproc in myprocs.prg and set procedure to myprocs.prg in the main program of the exe,
>
>Does this succeed ? myprogs.prg $ set('proc') --- if yes, just DO testproc, otherwise look for the reason
>
>>when I try DO testproc IN mytest.exe I get a "Procedure 'testproc.prg' does not exist". Looks like the "set procedure to" command does not get called in this case.
>
>nahh, fox probably thinks you are specifiying "IN mytest.exe" to look there for a top level program.
>I am not certain on setting a procedure file inside another exe - if that does not work, create a small setproc load function in mytest.exe that you call once on startup of myembellished.exe: do setprocfunc in mytest.exe.
>
>HTH
>
>thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform