[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2520.0. "VB4: Determine prgr mode: runtime or dev." by STOWKS::FBROUWER (Frits Brouwer / 889-9787) Thu Mar 20 1997 04:52

    
    Simple question (I hope ..)
    
    Is it possible to differentiate, in the code, between runtime and 
    dev. envirinm. ?? 
    The 'CurDir' functionality/result differs when you're in either of 
    the 2........
    (runtime : .EXE dir)
    (dev.    : VB dir)
    
    Frits
T.RTitleUserPersonal
Name
DateLines
2520.1MIASYS::HETRICKThu Mar 20 1997 12:377
	  'CurDir' is the current directory.  'App.Path' is the directory
     in which the application resides.  The two do not need to be the same
     -- in setting up a shortcut, you can specify the current directory for
     the application to be something other than the directory where the
     application resides.

				     Brian
2520.2how toXSTACY::PATTISONA rolling stone gets the wormMon Mar 24 1997 11:558
One way to do this is to use an SDK call to GetModuleFileName to
determine the exe name (see also App.hInstance)

If the answer is VB32.EXE then you know you are in the 
development environment. Anything else, you're not.

Dave
2520.3Try App.EXEnameMRSERV::PETERSWed Apr 23 1997 16:356
    I'd suggest looking at App.EXEname. But this won't do you any good if
    your EXE name is the same as your project name. Otherwise, this is
    a simple technique for what you want to do.
    
    Don