Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Am I a DLL?

Status
Not open for further replies.

SteveDingle

Programmer
Jul 26, 2004
254
GB
Heya All,

I was sure I had code for this but can't find it and couldn't find anything randomly searching here.

I want to exclude/include code based on if the code being run is inside a DLL. For instance, I wanted to use COMRETURNERROR when running the DLL, but not have it run if I'm using the code in an EXE, APP or inside vfp (testing)


Toodles,
Steve Dingle
D&S Business Solutions Ltd
 
Check StartMode in Help, it returns:
0 A development version of Visual FoxPro was started in an
interactive session.

1 Visual FoxPro was started as an application object. For
example, the following command creates an instance of
Visual FoxPro as an application object:

2 Visual FoxPro was started as an out-of-process .exe
automation server.

3 Visual FoxPro was started as an in-process .dll automation
server.

4 Visual FoxPro was started as a distributable .app or .exe
file.

5 Visual FoxPro was started as an in-process .dll automation
server for multithreaded use.

So you could use:

Code:
IF INLIST(_VFP.StartMode, 3 , 5)
   *** Do what you want to do in DLL mode
ELSE
   *** Application is not runned as DLL
ENDIF


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
ah.. StartMode!!!!

Thanks Boris, now I know what to look for I've found where I used it before (shoulda thought to search on "start")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top