Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generated menu not in menus directory
Message
From
09/07/2002 21:33:49
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00676159
Message ID:
00676885
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
Armin,

Actually, I did finally give up and do it through a project hook. If you're interested, here's what I did.

In GenMenu.prg, after "Private ALL" in the 'main program',
add the follwing line:
Public g_xxProject, g_xxMenuOutFile, g_xxMenuSourceFile
Then after the "No ! in menu name" bit of code, add these
three lines:
m.g_xxProject = JustFname(m.g_projdbf)
m.g_xxMenuOutFile = JustFName(m.g_outfile)
m.g_xxMenuSourceFile = JustFname(m.g_mnxfile[1])
Create a project hook - you probably already have one that
you use as your default project hook class, and in the
'AfterBuildEvent', add the following lines:
LOCAL lcProjPath, lcMenuOutPath, lcMenuSourcePath

IF nError = 0 And File(m.g_xxMenuOutFile)
  * get paths from the global vars from genmenu
  m.lcProjPath = JUSTPATH(FULLPATH(m.g_xxProject))
  m.lcMenuOutPath = JUSTPATH(FULLPATH(m.g_xxMenuOutFile))
  m.lcMenuSourcePath = JustPath(FullPath(m.g_xxMenuSourceFile))

  * if menu output file in same directory as project
  * move it into the same directory as the menu source file
  IF m.lcMenuOutPath = m.lcProjPath
    * if it already exists, dump it
    If File(AddBs(m.lcMenuSourcePath) + m.g_xxMenuOutFile)
      Erase (AddBs(m.lcMenuSourcePath) + m.g_xxMenuOutFile)
    Endif
    * move it
    RENAME (AddBs(m.lcProjPath) + m.g_xxMenuOutFile) to ;
      (AddBs(m.lcMenuSourcePath) + m.g_xxMenuOutFile)
  ENDIF
Endif
>Hi Alan,
>
>well, I had posted this message originally before I had tried to compile the project into an EXE, which doesn't work.
>
>Rebuilding the whole project works fine, building an APP shows no errors, but doesn't really create an APP (that's what I had tried first and thought that it would work). So I think there's no chance to get this to work eventually.
>
>Project hooks may be an alternative (copy the files from and to the menus directory before/after build), but I think I'll leave it as it is for now.
>
>Thanks,
>Armin
>
>------ Original message
>
>I've changed genmenu.prg as shown in the section below. I've had problems with the BUILD process when using the debugger, but without it seems to work. Nevertheless I would recommend the following:
>
>1) MODIFY COMMAND (_GENMENU)
>2) Make the changes.
>3) COMPILE (_GENMENU)
>
>Then delete the mpr files from the project's home directory and rebuild the complete project. Please let me know how this is working for you! If it does work for you, I'll add this to the FAQ section.
>
>
>*
>* VALIDPARAMS - Validate generator parameters.
>*
>* Description:
>* Attempt to open the project database.  If error encountered then
>* on error routine takes over and issues 'CANCEL'.  The output file
>* cannot be erased, name not known.
>*
>FUNCTION validparams
>
>*-- ...
>
>* No ! in menu name [Rev: 6][END]
>
>*--------------------------------------------------------------
>*-- Added Nd, 07/09/02
>*-- Overwrite path in m.g_outfile with the path to the mnx
>*-- file.
>*--------------------------------------------------------------
>m.g_outfile = FORCEPATH( m.g_outfile, JUSTPATH(g_mnxfile[1]) )
>*--------------------------------------------------------------
>*-- End Added Nd, 07/09/02
>*--------------------------------------------------------------
>
>*
>* REFRESHPREFS - Refresh comment style and developer preferences.
>*
>
>
>Armin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform