----------------------------------------------------------------- shtdll.dll v1.21 Copyright, June 1995, Minxiu Chen, All Rights Reserved ---------------------------------------------------------------- Shtdll.dll is a dll file, which can open and read the cell values of excel worksheets and lotus sheets. The source code is written in C. Shtdll.dll is only for worksheet, is not for workbook. The structure and functions within shtdll.dll are: struct Grd { int col; int row; long unReadbyte; } * LPGrd HFILE OpenSptFile( LPSTR FileName, LPSTR ext, LPSTR ctmext, LPGrd pgrd) HFile --- Returned file handle. FileName --- Filename for output. ext --- Filename extension for output. ctmext --- Custom filename extension for input. pgrd --- Pointer to a struct for output. BOOL ReadSheets(HFILE hFile, LPSTR ext, LPGrd pgrd, LPSTR lpval) HFile --- File Handle for input. ext --- Filename extension for input. pgrd --- Pointer to a struct for output. lpval --- Pointer to Cell value string for output. BOOL FlClose(void) HFile --- File Handle for input. The opensptfile function open a "file open dialog window", user can choice a spreadsheet to be opened, it return a file handle. The parameter FileName points to a string, which contains the user selected opened filename. In the "file open dialog window" the preset filter values are *.xls and *wk1. User can optionally enter a custom filter value ctmext, The parameter ext (a filename extension) and pgrd ( a point to a structure) contain information which should pass to ReadSheets function. The ReadSheets function reads a cell value with its column and row numbers. Parameter lpval points to a string contain the cell value, and pgrd contains its column number and row number. The unReadbyte can be used in a reading progress picture. if the call success it will return 1. Repeat to Call ReadSheets function until read out all cell values, then it return 0 and close the file. If user do not read all the cells, he may close the file with FlClose function. For the file opened by the custom filter, user should provide code for reading sheet. A Visual Basic sample application is included. If the user don't have vbrun300.dll in his/her window/system directory, he/she should download vbrun300.dll from SimTel, CICA or other sites and put in same directory as expr.exe or search path to run the expr.exe. For Visual Basic user the declare statement will be: Type grd col As Integer row As Integer unReadbyte As Long End Type Declare Function opensptfile Lib "shtdll.dll" (ByVal hFile As Integer, ByVal FileName As String, ByVal pext As String, ByVal ctmext As String, grddata As grd) As Integer Declare Function readsheets Lib "shtdll.dll" (ByVal hFile As Integer, ByVal pext As String, grddata As grd, ByVal txt As String) As Integer Declare Function flclose Lib "shtdll.dll" (ByVal hFile As Integer) As Integer For VB calling routines, you have to declare enough room for the returned string variables to receive them: Dim FileName As String * 128 Dim Pext As String * 3 Registration ============ The program shtdll.dll is distributed as a shareware program. You have the right to test this program for 10 days. You are allowed to copy this unregistered version and give it to any other person, as long as it is not modified in any way. Usage of this software after the evaluation period, If you find it useful and want to keep using it, you are obliged to register your copy, The registered user can get all newer versions free when upgrade. This software may not be used for commercial purpose without registration. Disclaimer ========== The program has been tested to keep it as bug-free. But I still declair it is supplied "As is" without warranty of any kind. You use it at your own risk. I accept no responsibility for any damage or loss, physical, financial, or otherwise, that may result from the use. If these terms are not acceptable to you, then you have NO license to use or test shtdll. You should IMMEDIATELY DELETE it from your disks.