I am using Adobe Acrobat to print to PDF. To do this, I have to
write to the Registry the name of the executable. How do I determine
this? My thoughts so far:

If the app is running as a collection of .fxp files under VFP,
then VFP is the actual executable. How do I find out the name of the
VFP executable? (I mean the name of the .exe that is VFP.)

If the app is running as an .exe, then sys(16,1) does it.

If the app is running as an .exe under VFP, then VFP is the
actual executable (I think). I can distinguish between this case and
the one before using version(2).

I think there might be other possibilities such as .app. (I have
never used a .app, nor do I even know how they are created.) There is
also the possibility of one .exe calling another and on and on. If I
have the first three above, that should do it for my case, and I need
them anyway before experimenting with the rest.

This is somewhat important as my app printing will not work
properly under the full VFP. This means that I would not have access
to the debugger and that I would have to build the .exe each time I
want to test anything to do with PDF printing.

Here is my code so far:

***** Start of Included Code *****
* tryname
* Try to Get Name of Executable
* Last Modification: 2006-10-25

? "*** Execution begins."

set talk off

local sys16name, apptype, underruntime, vfpexe, appname
sys16name=sys(16,1)
apptype=upper(right(sys16name,4))
underruntime=version(2)=0
vfpexe="***insert name of VFP executable***"

do case
case apptype=".FXP"
appname=vfpexe
? "running as .fxp under "+appname
case apptype=".EXE" and !underruntime
appname=vfpexe
? "running as .exe named "+appname
case apptype=".EXE" and underruntime
appname=sys16name
? "running as .exe under "+appname
otherwise
appname="???"
? "running in unknown state"
endcase

wait

? "*** Execution ends."

return
***** End of Included Code *****

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: VFP: Finding Name of Executable by Gene

Gene
Wed Oct 25 22:45:26 CDT 2006

Gene Wirchenko <genew@ocis.net> wrote:

> I am using Adobe Acrobat to print to PDF. To do this, I have to
>write to the Registry the name of the executable. How do I determine
>this? My thoughts so far:
>
> If the app is running as a collection of .fxp files under VFP,
>then VFP is the actual executable. How do I find out the name of the
>VFP executable? (I mean the name of the .exe that is VFP.)

After more hunting in the docs, I dragged out a tidbit called
_vfp.fullname. This works when running under full VFP. Under the
runtime, use sys(16,1). (Do not use _vfp.fullname then as it returns
a DLL name which is not what is wanted.)

[snip]

> I think there might be other possibilities such as .app. (I have
>never used a .app, nor do I even know how they are created.) There is
>also the possibility of one .exe calling another and on and on. If I
>have the first three above, that should do it for my case, and I need
>them anyway before experimenting with the rest.

I still do not know about this. Any light?

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: Finding Name of Executable by Carsten

Carsten
Thu Oct 26 02:00:33 CDT 2006

Gene,

just an idea.
messagbox( _VFP.ServerName )

--
Cheers
Carsten
_______________________________

"Gene Wirchenko" <genew@ocis.net> schrieb im Newsbeitrag
news:si80k2l302bbfddkcbflk39al3jqt1d6nf@4ax.com...
> I am using Adobe Acrobat to print to PDF. To do this, I have to
> write to the Registry the name of the executable. How do I determine
> this? My thoughts so far:
>
> If the app is running as a collection of .fxp files under VFP,
> then VFP is the actual executable. How do I find out the name of the
> VFP executable? (I mean the name of the .exe that is VFP.)
>
> If the app is running as an .exe, then sys(16,1) does it.
>
> If the app is running as an .exe under VFP, then VFP is the
> actual executable (I think). I can distinguish between this case and
> the one before using version(2).
>
> I think there might be other possibilities such as .app. (I have
> never used a .app, nor do I even know how they are created.) There is
> also the possibility of one .exe calling another and on and on. If I
> have the first three above, that should do it for my case, and I need
> them anyway before experimenting with the rest.
>
> This is somewhat important as my app printing will not work
> properly under the full VFP. This means that I would not have access
> to the debugger and that I would have to build the .exe each time I
> want to test anything to do with PDF printing.
>
> Here is my code so far:
>
> ***** Start of Included Code *****
> * tryname
> * Try to Get Name of Executable
> * Last Modification: 2006-10-25
>
> ? "*** Execution begins."
>
> set talk off
>
> local sys16name, apptype, underruntime, vfpexe, appname
> sys16name=sys(16,1)
> apptype=upper(right(sys16name,4))
> underruntime=version(2)=0
> vfpexe="***insert name of VFP executable***"
>
> do case
> case apptype=".FXP"
> appname=vfpexe
> ? "running as .fxp under "+appname
> case apptype=".EXE" and !underruntime
> appname=vfpexe
> ? "running as .exe named "+appname
> case apptype=".EXE" and underruntime
> appname=sys16name
> ? "running as .exe under "+appname
> otherwise
> appname="???"
> ? "running in unknown state"
> endcase
>
> wait
>
> ? "*** Execution ends."
>
> return
> ***** End of Included Code *****
>
> Sincerely,
>
> Gene Wirchenko
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.



Re: Finding Name of Executable by Dan

Dan
Thu Oct 26 08:07:07 CDT 2006

Take a look at the PROGRAM() function.


"Gene Wirchenko" <genew@ocis.net> wrote in message
news:si80k2l302bbfddkcbflk39al3jqt1d6nf@4ax.com...
> I am using Adobe Acrobat to print to PDF. To do this, I have to
> write to the Registry the name of the executable. How do I determine
> this? My thoughts so far:
>
> If the app is running as a collection of .fxp files under VFP,
> then VFP is the actual executable. How do I find out the name of the
> VFP executable? (I mean the name of the .exe that is VFP.)
>
> If the app is running as an .exe, then sys(16,1) does it.
>
> If the app is running as an .exe under VFP, then VFP is the
> actual executable (I think). I can distinguish between this case and
> the one before using version(2).
>
> I think there might be other possibilities such as .app. (I have
> never used a .app, nor do I even know how they are created.) There is
> also the possibility of one .exe calling another and on and on. If I
> have the first three above, that should do it for my case, and I need
> them anyway before experimenting with the rest.
>
> This is somewhat important as my app printing will not work
> properly under the full VFP. This means that I would not have access
> to the debugger and that I would have to build the .exe each time I
> want to test anything to do with PDF printing.
>
> Here is my code so far:
>
> ***** Start of Included Code *****
> * tryname
> * Try to Get Name of Executable
> * Last Modification: 2006-10-25
>
> ? "*** Execution begins."
>
> set talk off
>
> local sys16name, apptype, underruntime, vfpexe, appname
> sys16name=sys(16,1)
> apptype=upper(right(sys16name,4))
> underruntime=version(2)=0
> vfpexe="***insert name of VFP executable***"
>
> do case
> case apptype=".FXP"
> appname=vfpexe
> ? "running as .fxp under "+appname
> case apptype=".EXE" and !underruntime
> appname=vfpexe
> ? "running as .exe named "+appname
> case apptype=".EXE" and underruntime
> appname=sys16name
> ? "running as .exe under "+appname
> otherwise
> appname="???"
> ? "running in unknown state"
> endcase
>
> wait
>
> ? "*** Execution ends."
>
> return
> ***** End of Included Code *****
>
> Sincerely,
>
> Gene Wirchenko
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.



Re: Finding Name of Executable by Gene

Gene
Thu Oct 26 11:17:58 CDT 2006

"Dan" <dan@nospam.com> wrote:

>Take a look at the PROGRAM() function.

That is the first thing that I did. program() does not provide
sufficent detail (no path and no filetype). It also does not return
the name of the executable that is VFP when this is required. Did you
read my post?

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: Finding Name of Executable by Dan

Dan
Thu Oct 26 11:22:08 CDT 2006

Also take a look at _VFP.StartMode to find out how the app started up.

Gene Wirchenko wrote:
> I am using Adobe Acrobat to print to PDF. To do this, I have to
> write to the Registry the name of the executable. How do I determine
> this? My thoughts so far:
>
> If the app is running as a collection of .fxp files under VFP,
> then VFP is the actual executable. How do I find out the name of the
> VFP executable? (I mean the name of the .exe that is VFP.)
>
> If the app is running as an .exe, then sys(16,1) does it.
>
> If the app is running as an .exe under VFP, then VFP is the
> actual executable (I think). I can distinguish between this case and
> the one before using version(2).
>
> I think there might be other possibilities such as .app. (I have
> never used a .app, nor do I even know how they are created.) There is
> also the possibility of one .exe calling another and on and on. If I
> have the first three above, that should do it for my case, and I need
> them anyway before experimenting with the rest.
>
> This is somewhat important as my app printing will not work
> properly under the full VFP. This means that I would not have access
> to the debugger and that I would have to build the .exe each time I
> want to test anything to do with PDF printing.
>
> Here is my code so far:
>
> ***** Start of Included Code *****
> * tryname
> * Try to Get Name of Executable
> * Last Modification: 2006-10-25
>
> ? "*** Execution begins."
>
> set talk off
>
> local sys16name, apptype, underruntime, vfpexe, appname
> sys16name=sys(16,1)
> apptype=upper(right(sys16name,4))
> underruntime=version(2)=0
> vfpexe="***insert name of VFP executable***"
>
> do case
> case apptype=".FXP"
> appname=vfpexe
> ? "running as .fxp under "+appname
> case apptype=".EXE" and !underruntime
> appname=vfpexe
> ? "running as .exe named "+appname
> case apptype=".EXE" and underruntime
> appname=sys16name
> ? "running as .exe under "+appname
> otherwise
> appname="???"
> ? "running in unknown state"
> endcase
>
> wait
>
> ? "*** Execution ends."
>
> return
> ***** End of Included Code *****
>
> Sincerely,
>
> Gene Wirchenko
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.