Standard Library
TWinApp Class
This class is inherited from
CWinApp
and provides numerous additional member functions and variables to initialize,
terminate, lock, and otherwise manage an application. The member functions
and variables are as follows:
- TWinApp::TWinApp(LPCTSTR Name = NULL)
- This is the constructor. It initializes the data members.
Specify the application Name that Windows should use.
- TWinApp::~TWinApp()
- This is the destructor. It deallocates the data members, and clears
the application lock if it was set.
-
BOOL TWinApp::SetLockOut(CString AppName, CString Message)
- This member function may be called from the inherited class. It uses
the
CMutex
class to be sure no other instances of the current application are
running. If there is another instance, Message will be displayed to the
user and the function will return FALSE. Otherwise, the lock is set and
the function returns TRUE.
- BOOL TWinApp::Initialize(BOOL Sockets)
- This member function may be called from the inherited class. It calls
AfxEnableControlContainer()
and sets the VersionInfo and WinNT data members. If Sockets is TRUE,
WinSock and the NetTable data member are initialized.
- void TWinApp::SetDisplaySize()
- This member function may be called from the inherited class. It sets
the DisplayHeight, DisplayWidth, DisplaySize, and DisplayOffset data
members.
- BOOL TWinApp::WorkingFromHelp()
- This member function may be called from the inherited class. It sets
the Working data member to the path of the "working" directory (folder) by using
the Help path initialized by MFC.
-
void TWinApp::SetupProfile(CString FileName)
- This member function may be called from the inherited class. It sets
the current profile to the .INI file specified in FileName. This must be a
file in the Working directory (folder).
- BOOL TWinApp::LoadLoginInfo()
- This member function may be called from the inherited class. It sets
the UserName, ComputerName, GroupSize, GroupName, UserSid, UserDomain, and
UserSidUse data members from information gathered from the operating system
about the currently logged in user.
-
BOOL TWinApp::SetEventLog(CString AppName, BOOL Clear)
- This member function may be called from the inherited class. It
registers the EventSource data member. EventSource may then be used to
write to the Application Event Log. If Clear is TRUE, the current
Application Event Log will be cleared.
-
void TWinApp::SetPrinting(CFrameWnd*Parent)
- This member function may be called from the inherited class. It
initializes the PrintFile,
SDisView, and PrintFileName data
members. These may then be used by the printing functions throughout the
application.
-
BOOL TWinApp::CheckSecurity(CString Group)
- This public member function checks the specified Group to see if the current
user is a member of it. The GroupName data member is scanned for a
match. If a match is found, the function returns TRUE. Otherwise,
the function returns FALSE.
- void TWinApp::LoadIpNetTable()
- This public member function loads the NetTable and NetTableSize data members
with the current list of internet protocol addresses attached to the network
devices on the computer.
-
void TWinApp::PurgeIpNetEntry(CString TcpipAddress)
- This public member function deletes the specified TCP/IP Address from the
list of internet protocol addresses attached to the network devices on the
computer. Note that the specified TCP/IP Address will be deleted from
all network devices. Specify TcpipAddress as a character string
with the four parts separated by periods; i.e.,
"nnn.nnn.nnn.nnn".
-
virtual void TWinApp::ClearMessageQueue()
- This public member function should be called by application functions that
are looping inside lengthy processes and need to check a "Cancel" button on a
"progress" dialog box. It clears the pending message queue by invoking any
necessary message handlers.
-
BOOL TWinApp::SetAppLock(int Function, CString FileName = "")
- This public member function manages an application lock in the Working
directory (folder). This lock is a file with either shared or exclusive
access which may be used to prevent more than one user from starting a
"reorganization" application function. The FileName argument is not
presently used. The shared lock file name is LOCK-SHR.ON. The
organizing (exclusive) lock file name is LOCK-ORG.ON. Specify the desired
Function as follows:
1: | |
Set shared lock in database directory |
2: | |
Clear shared lock from database directory |
3: | |
Set organizing (exclusive) lock in database directory |
4: | |
Clear organizing (exclusive) lock from database
directory |
-
virtual void TWinApp::WinHelp(DWORD data, UINT cmd)
- This public member function invokes the Windows Help system with the Help ID
of the dialog box control where the mouse pointer is currently located. It
handles "Context Help" for the application.
- virtual int
TWinApp::GetProfileNumber(CString Section, CString Key)
- This public member function returns the number from the specified profile
Key in the specified Section of the profile file set by the
SetupProfile() member function.
- virtual BOOL
TWinApp::GetProfileSwitch(CString Section, CString Key)
- This public member function returns the switch from the specified profile
Key in the specified Section of the profile file set by the
SetupProfile() member function. If the profile Key is set to
an affirmative string ("Yes" or "On"), the function returns TRUE.
Otherwise, it returns FALSE.
-
virtual void TWinApp::GetProfileStringArray(CString Section,
CString Key, CStringArray&Strings)
- This public member function returns an array of strings from the specified
profile Key in the specified Section of the profile file set by the
SetupProfile() member function. Each string is separated by a
comma in the profile key.
- virtual void TWinApp::GetProfileStringArray(CString Section,
CString Key, CStringArray&Strings, int Count)
- This public member function returns an array of strings from the specified
profile Key in the specified Section of the profile file set by the
SetupProfile() member function. Each string is separated by a
comma in the profile key. Strings will contain the number of strings
specified by Count. If too many strings are specified in the profile key,
the excess will be ignored. If not enough are specified, null strings will
be added.
-
virtual void TWinApp::GetProfileSwitchArray(CString Section,
CString Key, BOOL*Switches, int Count)
- This public member function returns an array of switches from the specified
profile Key in the specified Section of the profile file set by the
SetupProfile() member function. Each switch is separated by a
comma in the profile key. If the switch is set to an affirmative string
("Yes" or "On"), the function sets the array value to TRUE. Otherwise, it
sets it to FALSE. Switches will contain the number of switches specified
by Count. If too many switches are specified in the profile key, the
excess will be ignored. If not enough are specified, FALSE switches will
be added.
-
virtual void TWinApp::GetProfileNumberArray(CString Section,
CString Key, int*Numbers, int Count)
- This public member function returns an array of numbers from the specified
profile Key in the specified Section of the profile file set by the
SetupProfile() member function. Each number is separated by a
comma in the profile key. Numbers will contain the number of numbers
specified by Count. If too many numbers are specified in the profile key,
the excess will be ignored. If not enough are specified, zeros will be
added.
- afx_msg void TWinApp::OnCurrentTime()
- This public member function displays a Message Box with the current time
shown both as local time and as Greenwich Mean Time.
-
afx_msg void TWinApp::OnOperatingSystem()
- This public member function displays a Message Box with the specifications
of the currently running operating system.
- CString TWinApp::PrintFileName
CPrintFile* TWinApp::PrintFile
CSDisView* TWinApp::SDisView
virtual void TWinApp::SDisExit()
afx_msg void TWinApp::OnGotoText()
afx_msg void TWinApp::OnGotoPage()
afx_msg void TWinApp::OnDownHalf()
afx_msg void TWinApp::OnDownScreen()
afx_msg void TWinApp::OnDownPage()
afx_msg void TWinApp::OnDownFinal()
afx_msg void TWinApp::OnDownList()
afx_msg void TWinApp::OnDownExit()
afx_msg void TWinApp::OnDownLine()
afx_msg void TWinApp::OnDown2()
afx_msg void TWinApp::OnDown3()
afx_msg void TWinApp::OnDown4()
afx_msg void TWinApp::OnDown5()
afx_msg void TWinApp::OnDown6()
afx_msg void TWinApp::OnDown7()
afx_msg void TWinApp::OnDown8()
afx_msg void TWinApp::OnDown9()
afx_msg void TWinApp::OnDown10()
afx_msg void TWinApp::OnUpHalf()
afx_msg void TWinApp::OnUpScreen()
afx_msg void TWinApp::OnUpPage()
afx_msg void TWinApp::OnUpStart()
afx_msg void TWinApp::OnUpLine()
afx_msg void TWinApp::OnUp2()
afx_msg void TWinApp::OnUp3()
afx_msg void TWinApp::OnUp4()
afx_msg void TWinApp::OnUp5()
afx_msg void TWinApp::OnUp6()
afx_msg void TWinApp::OnUp7()
afx_msg void TWinApp::OnUp8()
afx_msg void TWinApp::OnUp9()
afx_msg void TWinApp::OnUp10()
afx_msg void TWinApp::OnPrintScreen()
afx_msg void TWinApp::OnPrintPage()
afx_msg void TWinApp::OnPrintRemain()
afx_msg void TWinApp::OnPrintEntire()
afx_msg void TWinApp::OnPrintSystem()
afx_msg void TWinApp::OnPrintSetup()
- These public data members and functions are used to interface to the
CSDisView class which is instantiated as the SDisView
data member.
- CString TWinApp::UserName
BYTE TWinApp::UserSid[80]
SID_NAME_USE UserSidUse
CString TWinApp::UserDomain
CString TWinApp::ComputerName
CStringArray TWinApp::GroupName
int TWinApp::GroupSize
- These public data members contains information pertaining to the currently
logged in user.
- BOOL TWinApp::WinNT
- This public data member is TRUE if the current operating system is Windows
NT or Windows 2000. It is FALSE otherwise.
- int TWinApp::DisplayHeight
int TWinApp::DisplayWidth
int TWinApp::DisplaySize
int TWinApp::DisplayOffset
- These public data members contain the specifications of the current desktop
display.
-
OSVERSIONINFOEX TWinApp::VersionInfo
- This public data member contains information about the currently running
operating system.
-
PMIB_IPNETTABLE TWinApp::NetTable
- This public data member points to a structure that contains the TCP/IP
addresses currently attached to the network devices on the machine.
- CString TWinApp::AppName
- This public data member is initialized by the constructor to the name of the
current application.
- CString TWinApp::Working
CString TWinApp::HomeDirectory
CString TWinApp::DataDirectory
- These public data members contain the full paths to the respective
directories (folders).
- CRegistry TWinApp::Registry
- This public data member is used by various member functions in this and
other classes in the application to access the system registry.
- HANDLE TWinApp::EventSource
- This public data member is used to access the Application Event Log.
- BOOL TWinApp::AppLockShare
BOOL TWinApp::AppLockOrg
CFile TWinApp::LockFileShare
CFile TWinApp::LockFileOrg
- These data members may be inherited. They indicate the status of and
access the files that are the shared and organizational (exclusive) file
locks.
- char TWinApp::NetTableSpace[5000]
ULONG TWinApp::NetTableSize
- These data members may be inherited. They hold information about the
TCP/IP addresses currently attached to the network devices on the computer.
-
CMutex* TWinApp::LockOut
- This data member may be inherited. It accesses the application lock
set by the TWinApp::SetLockOut() member function.
-
POINT TWinApp::Cursor
- This data member may be inherited. It contains the coordinates of the
mouse pointer when the TWinApp::WinHelp() member function is
invoked.
[ CBinaryFile
| TCommandLineInfo
| CCommaFile
| TDateCtrl
| CDDE
| CDdeClient
| CDdeServer
]
[ CDirectoryLocator
| CDirectoryDialog
| CDirectoryFind
| CDirectoryNew
| CFileCopy
| TFrameWnd
]
[ InterfaceExcel
| CMaintFn
| CPrintFile
| CProcDialog
| TPrintDialog
| CProcPropertyPage
]
[ CProgress
| CRegistry
| CSDisCreate
| CSDisFile
| CSDisPage
| CSDisView
| CTableFile
]
[ CTaskIcon
| TPresent
| TTime
| TDate
| TDateTime
| CTransferData
| CXlTable
]
[ Stand-alone Programs
| Standard Library
| Conversion Functions
| Utility Functions
| COBOL Functions
]
[ Windows NT Library
| COBOL Library
| COBOL Interface
| Command Prompt Abbreviations
| Purchase Instructions
]
[ Home
| Areas of Expertise
| "We Do Windows"
| Clients and Projects
| Software Samples
| Package Software Available
]
[ Contact Information
| Business Software Philosophy
| Church Software Philosophy
]
All contents of this web site are Copyright © Titus Information Systems,
Inc., Phoenix, Arizona, U.S.A.