Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #13131 > unrolled thread

How detect run from IDE/EXE

Started by"Grzegorz R." <ramotny64@gmail.com>
First post2020-11-09 04:09 -0800
Last post2020-11-13 10:38 +0100
Articles 4 — 2 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  How detect run from IDE/EXE "Grzegorz R." <ramotny64@gmail.com> - 2020-11-09 04:09 -0800
    Re: How detect run from IDE/EXE "Wolfgang Riedmann" <wriedmann@gmail.com> - 2020-11-09 13:14 +0100
      Re: How detect run from IDE/EXE "Grzegorz R." <ramotny64@gmail.com> - 2020-11-09 06:32 -0800
        Re: How detect run from IDE/EXE "Wolfgang Riedmann" <wriedmann@gmail.com> - 2020-11-13 10:38 +0100

#13131 — How detect run from IDE/EXE

From"Grzegorz R." <ramotny64@gmail.com>
Date2020-11-09 04:09 -0800
SubjectHow detect run from IDE/EXE
Message-ID<8e61c8a6-baf0-4e80-a928-296d19c6bb7cn@googlegroups.com>
Hello all

is there any way to detect if app is run from IDE or EXE?

I need to switch off some actions if run from IDE (testing)...

Kind regards
Gregory

[toc] | [next] | [standalone]


#13132

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2020-11-09 13:14 +0100
Message-ID<i0sq5cFub00U1@mid.individual.net>
In reply to#13131
Hi Gregory,

> is there any way to detect if app is run from IDE or EXE?

check if your runnging exe has the .dbg extension instead of .exe.

function IsStartedFromIDE() as logic
//p wurde das Programm aus der IDE gestartet?
//s
	local lReturn		as logic
	local pszName		as psz
	local cName 		as string

	pszName			:= MemAlloc( 1024 )
	GetModuleFileName( _GetInst(), pszName, 1023 )
	cName 			:= PSZ2String( pszName )
	MemFree( pszName )
	lReturn			:= Upper( Right( cName, 4 ) ) == ".DBG"
	return lReturn 
	
HTH

Wolfgang

P.S. this is easy for VO, but unfortunately not so easy for X# because
there the executable is the "normal" exe

-- 

[toc] | [prev] | [next] | [standalone]


#13133

From"Grzegorz R." <ramotny64@gmail.com>
Date2020-11-09 06:32 -0800
Message-ID<56106e4e-82ff-4650-b5f5-dc933ff388f6n@googlegroups.com>
In reply to#13132
poniedziałek, 9 listopada 2020 o 13:14:39 UTC+1 Wolfgang Riedmann napisał(a):
> Hi Gregory,
> > is there any way to detect if app is run from IDE or EXE?
> check if your runnging exe has the .dbg extension instead of .exe. 
> 
> function IsStartedFromIDE() as logic 
> //p wurde das Programm aus der IDE gestartet? 
> //s 
> local lReturn as logic 
> local pszName as psz 
> local cName as string 
> 
> pszName := MemAlloc( 1024 ) 
> GetModuleFileName( _GetInst(), pszName, 1023 ) 
> cName := PSZ2String( pszName ) 
> MemFree( pszName ) 
> lReturn := Upper( Right( cName, 4 ) ) == ".DBG" 
> return lReturn 
> 
> HTH 
> 
> Wolfgang 
> 
> P.S. this is easy for VO, but unfortunately not so easy for X# because 
> there the executable is the "normal" exe 
> 
> --
Thank You

I though of detecting DBG but did not know how to get location...

GetModuleFileName is Windows function?

Do I understand corretly that debugging X# is more difficult than VO (no step by step debugger)? 

Gregory

[toc] | [prev] | [next] | [standalone]


#13143

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2020-11-13 10:38 +0100
Message-ID<i172hjF678U1@mid.individual.net>
In reply to#13133
Hi Gregory,

> I though of detecting DBG but did not know how to get location...
> 
> GetModuleFileName is Windows function?

yes, it is.

> Do I understand corretly that debugging X# is more difficult than VO
> (no step by step debugger)?


the debugger itself works much better, but when started from the IDE it
is not easy to detect that because it is the normal executable that
gets started.
To detect if running from the IDE I had to check the calling process to
see if it is Visual Studio or XIDE.

Wolfgang

-- 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web