PRB: Unable to Find Proc./Func. <Name>

This article was previously published under Q102586
This article has been archived. It is offered "as is" and will no longer be updated.
SYMPTOMS
When you are building an application (.APP) from a project that makesreference to a function or procedure that is contained within anotherapplication, FoxPro is unable to resolve the external reference. TheBuild function will display the following error message:
Unable to Find Proc./Func. <name>
RESOLUTION
At the bottom of the file, create a procedure stub that references theexternal function.

Additional ways to resolve this problem and their advantages anddisadvantages are explained at the end of the "More Information"section below.

NOTE: Using the EXTERNAL PROCEDURE <name> compiler directive does notresolve the problem.
MORE INFORMATION
The code example below demonstrates this error. Because the main .APPfile makes reference to a procedure stored in another .APP file, theBuild function is unable to resolve the reference.
  1. Open a new program file. Name it SUBAPP.PRG and include the following code:
          PROCEDURE MyFunc      WAIT WINDOW 'Myfunc called.'
  2. Save the program, and include it in a new project named SUBAPP.PJX. Save the project, and build an application named SUBAPP.APP.
  3. Create a file named MAINAPP.PRG. Include the following code:
          EXTERN PROCEDURE MyFunc      DO MyFunc IN SubApp.app
  4. Save the program and add it to a new project named MAINAPP.PJX. Save the project and build an application named MAINAPP.APP.

    During the build, as FoxPro is attempting to resolve external references, an alert will appear with the following text:
    Unable to Find Proc./Func. MYFUNC
    Locate, Ignore, Ignore All, Cancel
  5. In the alert box, choose Locate and choose SUBAPP.APP, which contains the procedure MyFunc. FoxPro will add the application as an excluded application to the project MainApp and complete the build. Run MAINAPP.APP, and the wait window will appear with the text "MyFunc called."
  6. Rebuild MAINAPP.PJX. Note that once again the "Unable to Find Proc./Func." alert appears. Attempting to locate SUBAPP.APP again will add yet another copy of the application as an excluded application to the project. You can choose Ignore instead, and FoxPro will rebuild MAINAPP.APP without error.
You can resolve this problem in one of three ways:
  • Choose Ignore when the Locate alert appears every time you rebuild your project. -or-

  • Remove the reference to SUBAPP.APP from the MAINAPP project, pack the project, and add a reference to the source program, in this case SUBAPP.PRG, which contains the source code for the procedure MyFunc. -or-

  • Add the following code to the end of MAINAPP.PRG:
          PROCEDURE MyFunc						
    This is a procedure stub that helps FoxPro resolve the external reference. Since the line of code that actually calls the procedure explicitly specifies the file in which the procedure actually resides, it is that procedure (in this case, the procedure in SUBAPP.APP) which will be called.

Notes

Both the second and the third options will eliminate the problem.However, while the second option requires the source code to beavailable and that it be built into the application, increasing itssize, the third option requires that the entire called applicationthat includes the single function be sent along with the callingapplication. If the source code to the function is not available, andyou would like to avoid the alert box, use the third method.
VFoxWin FoxDos FoxWin errmsg err msg gengraph.app refreshgrph showgrph updategrph updategr genpd.app
Properties

Article ID: 102586 - Last Review: 02/28/2014 07:53:22 - Revision: 2.1

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft FoxPro 2.5b
  • Microsoft FoxPro 2.5a
  • Microsoft FoxPro 2.0
  • Microsoft FoxPro 2.5b for MS-DOS
  • Microsoft FoxPro 2.5a
  • kbnosurvey kbarchive kberrmsg KB102586
Feedback