Readme | Program Description | Demos | Security

Uncache.ocx

General This control was designed to work in conjunction with a small program called any2gif.exe and with the Convert.ocx module of the QEEG program.

Any2gif.exe will place a 256-colour BMP header on any file, convert it to a GIF, and save it as FileName_(Extender).gif. For example, FileName.exe would become FileName_exe.gif. This usually results in about 50% compression for large EXEs and DLLs and allows the file to be referenced in an HTML document. The converted file and the HTML document may then be posted to appropriate web sites. When such a document is loaded by a Client browser, the GIF file will be downloaded to the Cache (even if it isn't visible on the document)

Convert.ocx is a little more specialized. It places a 256-colour BMP header on an EEG data file, converts it to a GIF, and appends an ini file containing information on Sampling Rate, Number of Channels, Gain, Source, etc. The extender is converted to _bmd.gif, signifying that it is a QEEG Bit-Mapped Data file. For example, SampleEEG.dat would be converted to SampleEEG_bmd.gif. When this GIF file is referenced in an HTML document and posted to the appropriate website, the Client browser will download the complete file to the Cache - including the appended ini.

If Internet Explorer (IE) is used as the browser and there are appropriate references to uncache.ocx in the HTML code, then GIF files created by either of the above methods will be retrieved from the Cache, transformed to their original code, and copied to a specified folder. The output filename is determined by the special extender, such that SampleEEG_bmd.gif would be converted to SampleEEG.bmd. And, if the output file has a BMD extender (ie if it was created by Convert.ocx), the appended ini parameters are also copied to the same folder as SampleEEG.ini. These files are then passed on to the QEEG program for further analysis. Or, if the GIF was created by any2gif.exe, it may be played (if it's a WAV), or displayed (if it's a GIF, JPG, or BMP), or executed with optional Command Line arguments (if it's an EXE).

Properties Uncache.ocx has 2 properties that may be set in the <OBJECT> Tag of the HTML code: Interval and FileName.

The Interval Property is passed on to a Timer control which activates the control code after a specified number of milliseconds. If this Property is set to 0, the timer is disabled and a Command Button becomes visible. In this case, the control will not be activated until the Client clicks the button. This is the default setting for this Property. To Auto-execute the control, this code must be added to the <OBJECT> Tag:

  • param name = "Interval" value = "50"

The actuall value is not critical - unless you really want to slow thing down. With the value set to 120000, for example, the control would lay dormant for 2 minutes.


The FileName Property accepts a single filename or a pipe-delineated list of names and commands (a Script, actually - with commands separated by the "|" character). For example, the default setting for this property is:

  • param name = "FileName" value = "SampleEEG_bmd.gif"

Thus, any GIF created by Convert.ocx could be renamed to SampleEEG_bmd.gif and placed in an HTML document along with Convert.ocx. With no code added, the file would be converted to SampleEEG.bmd and SampleEEG.ini when the Client clicks the Command button.
Unless otherwise instructed, these files would be copied to the Cache. In other words, the Cache is the default ouput folder. This is convenient for QEEG and Demos, but the output folder can be specified for other applications. For example:

  • param name = "FileName" value = "C:\Temp\|SampleEEG_bmd.gif"

...will copy the output files to C:\Temp\... If the folder doesn't exist, the control will create it.
The ..\Windows\ folder is symbolized as $(Win)\ and ..\Program Files\ as $(Prg)\. Thus...

  • ...value = "$(Win)\System\|SetKit432_dll.gif|$(Prg)\QEEG\|qeeg_exe.gif"

...would copy SetKit.dll to the ..\(Windows)\System\ folder and qeeg.exe to the
..\Program Files\QEEG\ folder.

Extender Code Files with upper case Extenders are 'Opened' after they are converted and copied. For example:
  • param name = "FileName" value = "$(Win)\Media\|Noise_WAV.gif"

...instructs the control to convert Noise_WAV.gif to ..\(Windows)\Media\Noise.wav and then play the WAV file (using a common API call (to sndPlaySoundA in winmm.dll)). Likewise:

  • ... value = "Muzak_MID.gif|Cmd=Muzak.mid|PlayMIDI_EXE.gif"

...would convert Muzak_MID.gif to Muzak.mid and play PlayMIDI_EXE.gif to PlayMIDI.exe and then play the MID file with PlayMIDI.exe. Since no folder is designated, the output files would be copied to the cache and ultimately flushed from the Client computer.

The above capabilities of this control are "Cheap Frills" - they required very little extra code and extend the usefulness of the control significantly. The WAV file doesn't require a player and can be used to signify that the control completed it's tasks successfully ("Transfer Complete..." by Majel Barrett, eg). Nice touch. But, more importantly, being able to start executable Programs and pass Command Line arguments adds considerable power to this device.

And, for the sake of completion:

  • ... value = "Graphic.GIF" or ... value = "Graphic.JPG"

...would display the graphic within the control. Which is rather redundant because the graphic is already displayed - unless it's invisible. But who knows, some day I may want to create a page that waits for 2 minutes before displaying a particular graphic

Patches Late in the development process I realized that most remote servers won't allow transfers larger than 1 MByte - and many EEG files are longer than that. And so are many other types of files. So I added functions to Convert.ocx and Any2gif.exe which will partion large files into 512K chunks and copy them to seperate GIFs. And I wrote a small (9K) program called Concat.exe that reassembles these chunks after they're fished out of the Cache of the Client computer.

For example: BigEEG.dat (1.5 MBytes long) would be partitioned into BigEEG_bmd_001.gif, BigEEG_bmd_002.gif, and BigEEG_bmd_003.gif - each about 512K long. When retrieved from the Cache and converted back to BMDs by uncache.ocx, these files would become BigEEG_bmd.001, BigEEG_bmd.002, and BigEEG_bmd.003. Then Concat.exe is called with the Command Line argument " BigEEG.bmd" (that is, Concat.exe BigEEG.bmd) and the original file is re-constructed.
This is the "FileName" Property code for the above example:

  • ...value = "BigEEG_bmd_003.gif|BigEEG_bmd_003.gif|BigEEG_bmd_003.gif|
  • Cmd=BigEEG.bmd|Concat.EXE.gif

The code for this patch will probably be included in the next version of this control, otherwise Concate.exe (in the form of Concat_EXE.gif) would have to be included with every file larger than 1 MegaByte and a lot more code has to be added to the FileName Property. Another few K added to uncache.ocx would eliminate that hassle

Dependencies Convert.ocx - Converts EEG data files to GIFs (84K)
any2gif.exe - Converts any files to GIFs (22K)
Concat.exe - Concatenates long files that have been partitioned for transfer.(9K)
MSVBVM50.DLL - VisualBASIC 5 Run-time Library (1.3M)
AsycFilt.dll - More VB5 libraries (145K)
MsStkPrp.dll - More VB5 libraries (92K)
Bugs Will force Alt-Ctrl-Del End Task if link broken