OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TMailer Class Reference

The TMailer class encapsulates the MAPI DLL (MAPI [32].DLL). More...

#include <owl/mailer.h>

Inheritance diagram for owl::TMailer:
owl::TModule owl::TStreamableBase

Public Member Functions

 TMailer ()
 
bool IsMAPIAvailable () const
 Returns true if the system is configured with a MAPI compliant client application installed.
 
void SendDocuments (TWindow *owner, LPCTSTR paths, LPCTSTR names=0, bool asynchWork=false)
 
void SendDocuments (TWindow *owner, const tstring &paths, const tstring &names=tstring(), bool asynchWork=false)
 
- Public Member Functions inherited from owl::TModule
 TModule (const tstring &name, bool shouldLoad=true, bool mustLoad=true, bool addToList=true)
 Constructs a TModule object that is used as an alias for a DLL.
 
 TModule (LPCTSTR name, THandle handle, bool addToList=true)
 Constructs a TModule object that is an alias for an already loaded DLL or program with an available HInstance.
 
 TModule (const tstring &name, THandle handle, bool addToList=true)
 String-aware overload.
 
 TModule (LPCTSTR name, THandle handle, const tstring &cmdLine, bool addToList=true)
 Constructs a TModule object for an ObjectWindows DLL or program from within LibMain or WinMain.
 
 TModule (const tstring &name, THandle handle, const tstring &cmdLine, bool addToList=true)
 String-aware overload.
 
virtual ~TModule ()
 Destructs a TModule, freeing the instance if appropriate, and deleting new'd strings.
 
void InitModule (THandle handle, const tstring &cmdLine)
 Finish-up initialization of a module.
 
virtual int Error (TXBase &x, uint captionResId, uint promptResId=0)
 Replaceable exception handler; may be redefined to process OWL exceptions if canResume is false, then the user doesn't have the option of ignoring.
 
LPCTSTR GetName () const
 Returns the name of the module.
 
void SetName (LPCTSTR name)
 Accessor function that sets the name of the module.
 
void SetName (const tstring &name)
 String-aware overload.
 
THandle GetHandle () const
 Return the instance handle of the library module represented by the TModule obect.
 
 operator THandle () const
 Returns the handle of the application or DLL module represented by this TModule.
 
bool operator== (const TModule &m) const
 Returns true if this instance is equal to the other instance; otherwise, returns false.
 
bool IsLoaded () const
 Returns a nonzero value if the instance handle is loaded.
 
int GetModuleFileName (TCHAR *buff, int maxChars) const
 Returns the expanded file name (path and file name) of the file from which this module was loaded.
 
tstring GetModuleFileName () const
 String-aware overload.
 
FARPROC GetProcAddress (TNarrowResId) const
 Returns the entry-point address of the specified exported function if found, otherwise returns NULL.
 
HRSRC FindResource (TResId id, TResId type) const
 Wrapper for the Windows API to find a particular resource.
 
HRSRC FindResourceEx (TResId id, TResId type, TLangId langId=LangNeutral) const
 Wrapper for the Windows API to find a particular resource.
 
HGLOBAL LoadResource (HRSRC hRsrc) const
 Wrapper for the Windows API.
 
uint32 SizeofResource (HRSRC hRsrc) const
 Wrapper for the Windows API.
 
int LoadString (uint id, TCHAR *buf, int maxChars) const
 Loads a string resource identified by id into the buffer pointed to by buff.
 
tstring LoadString (uint id) const
 Loads a string resource identified by id.
 
HBITMAP LoadBitmap (TResId id) const
 Wrapper for the Windows API.
 
HACCEL LoadAccelerators (TResId id) const
 Wrapper for the Windows API.
 
HMENU LoadMenu (TResId id) const
 Wrapper for the Windows API.
 
HCURSOR LoadCursor (TResId id) const
 Wrapper for the Windows API.
 
HICON LoadIcon (TResId name) const
 Wrapper for the Windows API.
 
std::string LoadHtml (TResId) const
 Loads the given HTML resource and returns it as a narrow string.
 
HICON CopyIcon (HICON hIcon) const
 Wrapper for the Windows API.
 
auto GetClassInfo (TWindowClassName, WNDCLASS *wndclass) const -> bool
 Retrieves information about the given window class.
 
auto GetClassInfo (TWindowClassName) const -> WNDCLASS
 Functional-style overload.
 
auto IsRegisteredClass (TWindowClassName) const -> bool
 Returns true if the given window class has been registered.
 
- Public Member Functions inherited from owl::TStreamableBase
virtual ~TStreamableBase ()
 

Public Attributes

TModuleProc5< ULONG, ULONG_PTR, LPSTR, LPSTR, LPSTR, ULONGMAPISendDocuments
 

Additional Inherited Members

- Public Types inherited from owl::TModule
typedef HINSTANCE THandle
 TModule encapsulates an HINSTANCE.
 
- Static Public Member Functions inherited from owl::TModule
static TModuleFindResModule (TResId id, TResId type)
 Global search for resources.
 
static TModuleNextModule (TModule *module=nullptr)
 
- Protected Member Functions inherited from owl::TModule
void SetHandle (THandle handle)
 Set the module instance handle.
 

Detailed Description

The TMailer class encapsulates the MAPI DLL (MAPI [32].DLL).

It provides an easy method to dynamically test for the availability of the DLL and bind to its exported functions at runtime. By using the TMailer class instead of direct calls to the MAPI DLL, ObjectWindows applications can provide the appropriate behavior when running in an environment where the DLL is not available.

Each data member of the TMailer class corresponds to the API with a similar name exposed by the MAPI DLL. For example, TMailerDll::MAPISendDocuments corresponds to the MAPISendDocuments API exported by the MAPI DLL. The following is a list of the members of the TMailer class corresponding to functions exposed by the DLL. For more information about these members, consult the documentation about the corresponding API exposed by the MAPI DLL.

Definition at line 40 of file mailer.h.

Constructor & Destructor Documentation

◆ TMailer()

owl::TMailer::TMailer ( )

Definition at line 25 of file mailer.cpp.

Member Function Documentation

◆ IsMAPIAvailable()

bool owl::TMailer::IsMAPIAvailable ( ) const

Returns true if the system is configured with a MAPI compliant client application installed.

Note
Verifies the [Mail] section of WIN.INI.

Definition at line 133 of file mailer.cpp.

References _T.

◆ SendDocuments() [1/2]

void owl::TMailer::SendDocuments ( TWindow * owner,
const tstring & paths,
const tstring & names = tstring(),
bool asynchWork = false )
inline

Definition at line 48 of file mailer.h.

◆ SendDocuments() [2/2]

void owl::TMailer::SendDocuments ( TWindow * owner,
LPCTSTR paths,
LPCTSTR names = 0,
bool asynchWork = false )

Definition at line 59 of file mailer.cpp.

References _MAX_PATH, _T, _tcscat, _tcstok, _USES_CONVERSION, _W2A, MAPISendDocuments, strnewdup(), and TRACE.

Member Data Documentation

◆ MAPISendDocuments

TModuleProc5<ULONG, ULONG_PTR, LPSTR, LPSTR, LPSTR, ULONG> owl::TMailer::MAPISendDocuments

Definition at line 51 of file mailer.h.


The documentation for this class was generated from the following files: