Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling funct in .app that exist in .exe only
Message
From
27/06/2012 13:42:16
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01546502
Message ID:
01547075
Views:
58
>>>>>I should apologize of the title is not clear; but I could not compose a better brief description.
>>>>>
>>>>>I have an EXE application (VFP 9 SP1) that calls an .APP application (also VFP 9 SP1). Some code in .APP calls function(s) that exist only in the .EXE (simply because the .EXE and .APP share some class libraries). So when I compile/build the .APP I get a bunch of Unknow FunctionName - Undefined messages. But I have not seen error messages at run time. Does it mean that at run time when the code in the .APP calls one of the "unknown" functions they fire from the main .EXE?
>>>>
>>>>If a function is not available in the current context, FoxPro searches the calling context.
>>>>
>>>>If you're looking to silence compile-time errors, you could create a PRG that contains just the procedure and function headings of the routines in the EXE that are being referenced in the APP, then add this PRG to the project for the APP and set it as excluded.
>>>
>>>First, thank you. But how do you create procedure and function headings? I am thinking that if I create a "dummy" procedure/function of the same name, at run time, these "dummy" procedure will be called. Do you see what confuses me?
>>
>>As I mentioned -- just simply add the "stub" to the project, but set it (the "stub") as excluded. The excluded "stub" makes the compiler happy, but since the "stub" is excluded, the functions don't exist in the APP context -- so the calling EXE will be searched.
>
>I got it. Thank you.

At the bottom of your main.prg
PROCEDURE Dummy
EXTERNAL PROCEDURE commonfunction
EXTERNAL REPORT reportname
ENDPROC
As long as nothing ever calls Dummy, these will make the compiler happy and will not exist as a routine that might be called.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform