DumontEXE 0.0.1
Public Types | Public Slots
DumontEXE Class Reference

Dumont Primary Application Interface object. More...

#include <DumontEXE.h>

Inheritance diagram for DumontEXE:

List of all members.

Public Types

enum  GuidFormats {
  rawDataGuid, registryGuid, headerProtectGuid, oleCreateGuid,
  defGuid, staticGuid
}
 Guid Output Formats
. More...

Public Slots

cmcDatabaseApi::cmcApplicationapp (IDispatch *dispatch)
 Return a wrapped application object
.
void appendTextFile (const QString &fileName, const QString &data)
 Append some text to a file
.
cmcDatabaseApi::cmcApplicationapplication (const QString &databaseName)
 Fetch a specific application instance by name
.
cmcDatabaseApi::cmcApplicationsapplications ()
 Return the Commence Running Applications Table
.
QString compress (const QString &data, int level=-1)
 Compress a String.
long crc16 (const QString &data)
 Generate a 16-bit CRC on some data.
long crc32 (const QString &data)
 Generate a 32-bit CRC on some data.
void critical (const QString &msg="")
 Send a critical message
.
QString dateTimeStamp (long length)
 Return Current Date/Time Stamp
.
QString dateTimeStamp (const QDateTime &dateTime=QDateTime::currentDateTime(), long length=14)
 Return a particular Date/Time Stamp
.
void debugClear ()
 Send a debug message
.
QString dq (const QString &string)
 Quote a String
.
void fatal (const QString &msg="")
 Send a fatal message
.
QString fileOpenDialog (const QString &caption, const QString &dir, const QString &filter="")
 Present a File-Open dialog to the user
.
cmcDatabaseApi::cmcFormform (IDispatch *dispatch)
 Wrap a Form
.
QString guid (long format=registryGuid, bool ucase=false)
 Return a new GUID
.
QxtLoggerlog ()
 Return a handle to the system log
.
QxtLoggerWindowlogWindow (const QString &name="Log Window", bool show=false, bool clear=false, long x=-1, long y=-1, long w=-1, long h=-1)
 Open/Fetch a logging window by name
.
winDumontEXEmainWindow ()
 Return a handle to the main application window
.
QString md5 (const QString &data)
 Generate an MD5 hash of data.
void print (const QString &msg="")
 Send a debug message
.
bool run (const QString program, const QString argument1="", const QString argument2="", const QString argument3="", const QString argument4="", const QString argument5="", const QString argument6="", const QString argument7="", const QString argument8="")
 Run a Program
.
void test ()
 Quick Test Slot
.
void textFile (const QString &fileName, const QString &data)
 Write some text to a file.
QString version ()
 Return Dumont's version number
.
void warning (const QString &msg="")
 Send a warning message
.

Detailed Description

Dumont Primary Application Interface object.

This object represents the primary interface to the Dumont application. It is from here that you can wrap the various Commence objects, register applications into the DumontROT and do lots of other things.

Todo:
Provide an application update module to allow Dumont to check a central repository and bring down updates. Be sure to include a mechanism whereby an update can be easily reversed. Frankly, the whole cmcDatabaseApi modue should be placed into a plugin, where versions can be quickly and easily managed. Also, I'd like to see the cmcDatabaseApi on a single code-base so that it can be compiled into a stand-alone dll, compiled into a stand-alone static executable, or compiled into a Qt plugin.

Definition at line 230 of file DumontEXE.h.


Member Enumeration Documentation

Guid Output Formats
.

Enumerator:
rawDataGuid 
  • 0 ~ "080b29a9175a4096b450b1ff11a7816c"

registryGuid 
  • 1 ~ "{080b29a9-175a-4096-b450-b1ff11a7816c}" (default)

headerProtectGuid 
  • 2 ~ "_080b29a9_175a_4096_b450_b1ff11a7816c"

oleCreateGuid 
  • 3 ~ "IMPLEMENT_OLECREATE(<<class>>, <<external_name>>, 0x080b29a9, 0x175a, 0x4096, 0xb4, 0x50, 0xb1, 0xff, 0x11, 0xa7, 0x81, 0x6c);"

defGuid 
  • 4 ~ "DEFINE_GUID(<<name>>, 0x080b29a9, 0x175a, 0x4096, 0xb4, 0x50, 0xb1, 0xff, 0x11, 0xa7, 0x81, 0x6c);"

staticGuid 
  • 5 ~ "static const GUID <<name>> = { 0x080b29a9, 0x175a, 0x4096, { 0xb4, 0x50, 0xb1, 0xff, 0x11, 0xa7, 0x81, 0x6c } };"

Definition at line 251 of file DumontEXE.h.


Member Function Documentation

cmcDatabaseApi::cmcApplication * app ( IDispatch *  dispatch) [slot]

Return a wrapped application object
.

This function wraps an application object. It is intended to be called from a detail form vbScript with an existing application object handle as follows:

Form vbScript Example
 dim dexe: set dexe = createObject("Dumont.EXE")
 dim dapp: set dapp = dexe.app(Application)

Definition at line 242 of file DumontEXE.cpp.

void appendTextFile ( const QString &  fileName,
const QString &  data 
) [slot]

Append some text to a file
.

File contents will be preserved

Definition at line 124 of file DumontEXE.cpp.

cmcDatabaseApi::cmcApplication * application ( const QString &  databaseName) [slot]

Fetch a specific application instance by name
.

Definition at line 232 of file DumontEXE.cpp.

cmcApplications * applications ( ) [slot]

Return the Commence Running Applications Table
.

This function returns a handle to the Commence Running Applications Table. From that table a user can gain access to any database that has been registered with the DumontEXE application. This allows a single database Form script to access anything in a different database, *and* also allows extern .vbs programs and other programs to access specific instances of running Commence databases.

vbScript Example:
 dim dexe: set dexe = createObject("Dumont.EXE")
 dim dap1: set dap1 = dexe.applications.get("Leads Database")
 dim dap2: set dap2 = dexe.applications.get("Order Processing System")

The two handles, .dap1. and .dap2. now (probably) point to entirely two different Commence database application sessions. I say 'probably' because it is entirely possible that one of the databases has been closed, or a different db opened since it was registered with Dumont.

Definition at line 226 of file DumontEXE.cpp.

QString compress ( const QString &  data,
int  level = -1 
) [slot]

Compress a String.

Compresses the string and returns the compressed data in a new byte array.

The compressionLevel parameter specifies how much compression should be used. Valid values are between 0 and 9, with 9 corresponding to the greatest compression (i.e. smaller compressed data) at the cost of using a slower algorithm. Smaller values (8, 7, ..., 1) provide successively less compression at slightly faster speeds. The value 0 corresponds to no compression at all. The default value is -1, which specifies zlib's default compression.

Definition at line 444 of file DumontEXE.cpp.

long crc16 ( const QString &  data) [slot]

Generate a 16-bit CRC on some data.

Definition at line 419 of file DumontEXE.cpp.

long crc32 ( const QString &  data) [slot]

Generate a 32-bit CRC on some data.

This does the same thing as the crc16 except it runs the crc on the data string twice, once in forward order and once in reverse order.

Definition at line 431 of file DumontEXE.cpp.

void critical ( const QString &  msg = "") [slot]

Send a critical message
.

Definition at line 216 of file DumontEXE.cpp.

QString dateTimeStamp ( long  length) [slot]

Return Current Date/Time Stamp
.

This function returns a string suitable for a date time stamp using the current system date/time.

vbScript Example ~ Time/Date stamp of current Date/Time
 dim dexe: set dexe = createObject("Dumont.EXE")
 msgBox "Current Date/Time Stamp: " & dexe.dateTimeStamp
Attention:
Do not try to use this function for producing extremely accurate time tracking - like tracking the running of a program, from some external program that runs multiple times. For instance, you can call this function from a .vbs file, and you can run that .vbs file repeatedly, quickly. You can get in to a situation where multiple seperate instances of that .vbs program are hammering on this function, and even though one of the instances was launched first, it might not get to this function before another instance that was launched after... that's entirely up to windows. Therefore, you could have an instance that was launched before another getting a time value later than the second... if that makes any sense at all. Of course, all of this is only true if you are relying on the millisecond return value.
See also:
dateTimeStamp( Date/Time, Length )
Returns:
String ~ Date/Time Stamp formatted to: yyyyMMddhhmmsszzz
Parameters:
lengthlong (optional) ~ specify number of characters to return from the dateTime stamp. This parameter is optional. You can specify this if you only want a portion of the date/time stamp. It specifies the left-most length characters.

Definition at line 253 of file DumontEXE.cpp.

QString dateTimeStamp ( const QDateTime &  dateTime = QDateTime::currentDateTime(),
long  length = 14 
) [slot]

Return a particular Date/Time Stamp
.

This function returns a string suitable for a date time stamp using the current system date/time.

vbScript Example ~ Time/Date stamp of current Date/Time
 dim dexe: set dexe = createObject("Dumont.EXE")
 msgBox "Current Date/Time Stamp: " & dexe.dateTimeStamp
Attention:
Do not try to use this function for producing extremely accurate time tracking - like tracking the running of a program, from some external program that runs multiple times. For instance, you can call this function from a .vbs file, and you can run that .vbs file repeatedly, quickly. You can get in to a situation where multiple seperate instances of that .vbs program are hammering on this function, and even though one of the instances was launched first, it might not get to this function before another instance that was launched after... that's entirely up to windows. Therefore, you could have an instance that was launched before another getting a time value later than the second... if that makes any sense at all. Of course, all of this is only true if you are relying on the millisecond return value.
See also:
dateTimeStamp( Current Date/Time )
Returns:
String ~ Date/Time Stamp formatted to: yyyyMMddhhmmsszzz
Parameters:
dateTimeDateTime ~ value to be converted
lengthlong (optional) ~ specify number of characters to return from the dateTime stamp. This parameter is optional. You can specify this if you only want a portion of the date/time stamp. It specifies the left-most length characters.

Definition at line 258 of file DumontEXE.cpp.

void debugClear ( ) [slot]

Send a debug message
.

Definition at line 201 of file DumontEXE.cpp.

QString dq ( const QString &  string) [slot]

Quote a String
.

Definition at line 353 of file DumontEXE.cpp.

void fatal ( const QString &  msg = "") [slot]

Send a fatal message
.

Definition at line 221 of file DumontEXE.cpp.

QString fileOpenDialog ( const QString &  caption,
const QString &  dir,
const QString &  filter = "" 
) [slot]

Present a File-Open dialog to the user
.

This feature has been provided in Dumont to deal with the lack of FileOpen in the Vista operating system. It does not model the "UserAccounts.CommonDialog" interface, and probably never will, but its interface is pretty simple. The Dialog Window is based upon the Qt FileOpen dialog window found on the http://doc.trolltech.com/4.3/qfiledialog.html website.

Normally, in Qt, file and folder paths are handled with "/" (forward slash) characters. This is common in the Linux world. However, this is somewhat incompatible with windows, since windows employs the "\" (back slash) character when dealing with file and folder paths. Therefore, this routine has been modified to change all incoming "\" characters to "/" before employing the dialog, and then change all "/" characters from the dialog back into "\" characters for the caller. This should simplify employing this dialog in windows based applications that are expecting the "\" character.

In its simplest form, the Dialog returns the string of the full-path to the selected file. If the user presses 'cancel', an empty string is returned.

vbScript Example
 sub SelectTheFile()
   dim dexe: set dexe = createObject("Dumont.EXE")
   dim selectedFile
       selectedFile = dexe.fileOpenDialog( _
        "Pick a File", _
        "C:\Documents and Settings\mark\My Documents", _
        "Docs (*.doc;*.wpd)" )
   if( selectedFile = "" ) then
     msgbox "no file was selected"
   else
     msgbox "you selected the file: " & selectedFile
   end if
 end sub
fileOpenDialog.jpg
Note:
This doesn't work when called from within a Commence detail form - it times out. It does, however, work when called from a vbScript program. If you want to use this routine from within your Commence detail forms, see the DumontDLL project and the fileOpenDialog command found there.
When calling this function, note that the Commence 'detail form' is is *not* modal. This could be a potential problem if the user closes the detail form before closing this FileOpen dialog either by 'cancel' or 'open'. If the user does first close the detail form without properly acknowledging this dialog window, then Commence will simply crash.

Definition at line 395 of file DumontEXE.cpp.

cmcDatabaseApi::cmcForm * form ( IDispatch *  dispatch) [slot]

Wrap a Form
.

This function wraps a regular Commence Form object with a specially enhanced Dumont Form object. The Dumont Form object has significantly improved form handling functionalities.

vbScript Example ~ Wrapping a Commence Form
 dim dexe: set dexe = createObject("Dumont.EXE") ' Hook Dumont
 dim dfrm: set dfrm = dexe.form(Form)            ' Wrap Ourselves

Wrapping a form in this matter causes a special Form object to be returned by Dumont. It also causes this form object to be registered in the Dumont Form R.O.T. list, providing access to this form from other parts of the application.

Definition at line 248 of file DumontEXE.cpp.

QString guid ( long  format = registryGuid,
bool  ucase = false 
) [slot]

Return a new GUID
.

Format a new GUID

Definition at line 348 of file DumontEXE.cpp.

QxtLogger * log ( ) [slot]

Return a handle to the system log
.

Definition at line 135 of file DumontEXE.cpp.

QxtLoggerWindow * logWindow ( const QString &  name = "Log Window",
bool  show = false,
bool  clear = false,
long  x = -1,
long  y = -1,
long  w = -1,
long  h = -1 
) [slot]

Open/Fetch a logging window by name
.

This fetches a logging window by name. You can have as many Logging windows in your system that you want - depending on memory limitations.

vbScript Example ~ Opening and Printing to a Logging Window
 dim dexe: set dexe = createObject("Dumont.EXE")
 dim dlog: set dlog = dexe.logWindow("MyLoggingWindow")
 
 dlog.print "This message is appended to the log"

As long as the dumont application remains running, the contents of the logging window will remain. You can clear and save the contents of the logging window, and show the logging window, and actually watch the logging window while information is being posted to it.

By specifying any of the position parameters, the window will be shown immediately. By not specifying these parameters, the will will be placed in the last location.

Returns:
Logger Window
Parameters:
namestring ~ Title/Name of logging window

showboolean (default false) ~ show the window automatically

clearboolean (default false) ~ clear the window automatically

xinteger (optional) ~ left/right position, defaults to last

yinteger (optional) ~ top/bottom position, defaults to last

winteger (optional) ~ width, defaults to last

hinteger (optional) ~ height, defaults to last

Definition at line 143 of file DumontEXE.cpp.

winDumontEXE * mainWindow ( ) [slot]

Return a handle to the main application window
.

Definition at line 112 of file DumontEXE.cpp.

QString md5 ( const QString &  data) [slot]

Generate an MD5 hash of data.

Definition at line 406 of file DumontEXE.cpp.

void print ( const QString &  msg = "") [inline, slot]

Send a debug message
.

Definition at line 373 of file DumontEXE.h.

bool run ( const QString  program,
const QString  argument1 = "",
const QString  argument2 = "",
const QString  argument3 = "",
const QString  argument4 = "",
const QString  argument5 = "",
const QString  argument6 = "",
const QString  argument7 = "",
const QString  argument8 = "" 
) [slot]

Run a Program
.

Definition at line 364 of file DumontEXE.cpp.

void test ( void  ) [slot]

Quick Test Slot
.

This slot is used for performing quick Qt tests without requiring a big API implementation or supporting objects.

Definition at line 7 of file DumontTest.cpp.

void textFile ( const QString &  fileName,
const QString &  data 
) [slot]

Write some text to a file.

File contents will be overwritten

Definition at line 117 of file DumontEXE.cpp.

QString version ( ) [slot]

Return Dumont's version number
.

Definition at line 107 of file DumontEXE.cpp.

void warning ( const QString &  msg = "") [slot]

Send a warning message
.

Definition at line 211 of file DumontEXE.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com