_App interface
The interface implemented by the global App object, which exposes information about the running executable — its name, path, version, instance handle, and related metadata.
App is a predeclared global object of type App (a CoClass that implements _App). It is available in every twinBASIC project without any declaration or instantiation. All members are accessed through the App global:
Debug.Print App.EXEName
Debug.Print App.Major & "." & App.Minor & "." & App.Revision
Properties
Build
The build-number component of the project version, as configured in the project settings. Integer. Read-only.
See Build.
Comments
The Comments field from the compiled executable’s version information. String. Read-only.
See Comments.
CompanyName
The Company Name field from the compiled executable’s version information. String. Read-only.
See CompanyName.
EXEName
The name of the running executable, without the path or file extension. String. Read-only.
See EXEName.
FileDescription
The File Description field from the compiled executable’s version information. String. Read-only.
See FileDescription.
HelpFile
The path to the project’s help file. String. Read/write.
See HelpFile.
hInstance
The Win32 instance handle (HINSTANCE) of the running executable or DLL. LongPtr. Read-only.
See hInstance.
IsInIDE
True when code is executing inside the twinBASIC IDE; False when running as a compiled executable. Boolean. Read-only.
See IsInIDE.
LastBuildPath
The full path to the output file produced by the most recent build. String. Read-only.
See LastBuildPath.
LegalCopyright
The Legal Copyright field from the compiled executable’s version information. String. Read-only.
See LegalCopyright.
LegalTrademarks
The Legal Trademarks field from the compiled executable’s version information. String. Read-only.
See LegalTrademarks.
LogMode
The current logging mode. A member of LogModeConstants. Read-only.
Note
Currently only vbLogOff and vbLogAuto are supported, for IDE-detection purposes.
Major
The major-version component of the project version. Integer. Read-only.
Minor
The minor-version component of the project version. Integer. Read-only.
ModulePath
The full path to the running executable or DLL, including the file name and extension. String. Read-only.
See ModulePath.
Path
The directory that contains the running executable, without a trailing path separator. String. Read-only.
See Path.
PrevInstance
True when another instance of this executable was already running when this instance started. Boolean. Read-only.
ProductName
The Product Name field from the compiled executable’s version information. String. Read-only.
Revision
The revision component of the project version. Integer. Read-only.
ThreadID
The Win32 thread ID of the main thread. Long. Read-only.
Title
The application title, as shown in the Windows taskbar and task list. String. Read/write.
The initial value comes from the project settings. Assigning to Title updates the running process’s description immediately.
Methods
LogEvent
Writes an entry to the application event log.
Note
LogEvent is currently unimplemented. Calls are accepted but have no effect.
Syntax: App.LogEvent LogBuffer, EventType
- LogBuffer
- required A String containing the message to write.
- EventType
- required A Variant specifying the event severity.
StartLogging
Begins logging application events to the specified target.
Note
StartLogging is currently unimplemented. Calls are accepted but have no effect.
Syntax: App.StartLogging LogTarget, LogModes
- LogTarget
- required A String specifying the log destination (a file path or the Windows event log).
- LogModes
- required A Long composed of LogModeConstants flags that controls what is logged.
Remarks
The following _App properties are declared in the interface but are not yet implemented in twinBASIC. Reading or writing them has no effect:
- LogPath
- NonModalAllowed
- OleRequestPendingMsgText
- OleRequestPendingMsgTitle
- OleRequestPendingTimeout
- OleServerBusyMsgText
- OleServerBusyMsgTitle
- OleServerBusyRaiseError
- OleServerBusyTimeout
- RetainedProject
- StartMode
- TaskVisible
- UnattendedApp
See Also
- AppGlobalClassObject Package – package overview