Running as .EXE or running in VB Design Environment 
Author Message
 Running as .EXE or running in VB Design Environment

Hi VBP's,

how can I detect if my program is started as an .EXE file or is running in
VB4 design environment??? I've read that "app.exename" returns different
names in both cases, but this seems not to be correct (or I misunderstood
the readings).
Has anyone other tips to distinguish between this two cases?

So long,
Kai



Tue, 05 Oct 1999 03:00:00 GMT  
 Running as .EXE or running in VB Design Environment

This is a multi-part message in MIME format.

------=_NextPart_000_01BC4C24.A1EE1680
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Compiled EXE??
Try using the GetModuleFileNameA API call. This should return VB's =
executable if your app isn't compiled, and will return your own app's =
filename if it is.
    --
    -- Ben
    SiteBuilder Network Level 2
    Ben's VB5 Page -- This site has been Activated!
    http://www.{*filter*}highway.com/~psy/
    Requires IE3.01 or higher...
   =20
     Dr. Kai Ewald wrote in article =

    Hi VBP's,
    how can I detect if my program is started as an .EXE file or is =
running in
    VB4 design environment??? I've read that "app.exename" returns =
different
    names in both cases, but this seems not to be correct (or I =
misunderstood
    the readings).
    Has anyone other tips to distinguish between this two cases?
   =20
   =20

------=_NextPart_000_01BC4C24.A1EE1680
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"Trident 4.71.0544.0"' name=3DGENERATOR>

</HEAD>
<BODY background=3Dhttp://www.{*filter*}highway.com/~psy/PaperBar.gif>
<P><FONT face=3DArial size=3D2><FONT face=3D"Arial Black"><FONT =
size=3D+3>Compiled=20
EXE??</FONT></FONT></FONT>

<BLOCKQUOTE>
    <P><FONT face=3DArial size=3D2>Try using the GetModuleFileNameA API =
call. This=20
    should return VB's executable if your app isn't compiled, and will =
return=20
    your own app's filename if it is.<BR>
    --<BR>
    <HTML><BODY><FONT size=3D2>-- Ben<BR>
    SiteBuilder Network Level 2<BR>
    Ben's VB5 Page -- This site has been Activated!<BR>
    <A=20
    =
href=3D"http://www.{*filter*}highway.com/~psy/">http://www.{*filter*}highway.com/~p=
sy/</A><BR>
    Requires IE3.01 or higher...<BR>
    </FONT></FONT>
   =20
    <P><EM><FONT color=3D#808080 face=3DArial size=3D2> Dr. Kai=20


    <HTML><BODY>Hi VBP's,<BR>
    how can I detect if my program is started as an .EXE file or is =
running=20
    in<BR>
    VB4 design environment??? I've read that &quot;app.exename&quot; =
returns=20
    different<BR>
    names in both cases, but this seems not to be correct (or I=20
    misunderstood<BR>
    the readings).<BR>
    Has anyone other tips to distinguish between this two cases?<BR>
    </FONT></EM></P>
   =20
</BLOCKQUOTE>
</BODY></HTML>

------=_NextPart_000_01BC4C24.A1EE1680--



Tue, 05 Oct 1999 03:00:00 GMT  
 Running as .EXE or running in VB Design Environment

I have had the same problem

the "app.exename" only returns different if your app name is <> exename

I currently use /Test on the commandline in the design environment.

Other ways are....

microsoft.com .tips shows how to use vb5 VBIDE referencing to do it, only
one line of code, but requires you reference the 'VBIDE' library (project,
references), too much ahssle for me, I want a routine that works without
adding extra libraries.

OR...

The GetModuleFilename API will return 'VB' for design and 'exename' for
compiled code, not looked into this one yet, so cannot offer much help
here, if you get it working, send me the code extract please...




Quote:
> From my bag of tricks: In VB you can set a command line parameter
> from one of the menu items (it's changed from VB4 to 5) and use
> a parameter such as "/not EXE" or anything weird.

> Now in your program use the Command function to get the command
> line.  If it is the weird thing you put in the development menu
> then you are in development mode.  If you ran an .EXE with no
> 'weird' command line you can tell.

> Have fun



> > Hi VBP's,

> > how can I detect if my program is started as an .EXE file or is running
in
> > VB4 design environment??? I've read that "app.exename" returns
different
> > names in both cases, but this seems not to be correct (or I
misunderstood
> > the readings).
> > Has anyone other tips to distinguish between this two cases?

> > So long,
> > Kai



Sat, 30 Oct 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HOWTO: Tell Whether an App Runs in VB Design Environment

2. running VB exe from a VB exe

3. how to tell at runtime if ran application from exe or from development environment

4. How tell if running in exe or vb4 Dev environment

5. EXE run not same as Design time problem

6. Runs in design mode, NOT Run Time.

7. Runs in Design Mode, NOT Run Time

8. Code running in design time or run-time?

9. Assign a treeview at design run time to other at design time

10. .EXE running from AT service on NT won't run with ORACLE ODBC

11. web service and updating web reference with vb.net design time vs run time

12. web service and updating web reference with vb.net design time vs run time

 

 
Powered by phpBB® Forum Software