Index: /swishctl/AUTHORS =================================================================== --- /swishctl/AUTHORS (revision 1236) +++ /swishctl/AUTHORS (revision 1236) @@ -0,0 +1,6 @@ +Original Author: + Greg Ford + +SWISH-E Project Integration: + David Norris + Index: /swishctl/doc/style.css =================================================================== --- /swishctl/doc/style.css (revision 1240) +++ /swishctl/doc/style.css (revision 1240) @@ -0,0 +1,83 @@ + +body { + /* font-family: helvetica, arial, sans-serif; */ + color: #000000; + background-color: #ffffff; + margin: 1em 4em 0em 2em; +} + +h1, h2, h3 { + color: #005A9C; +} + + +h1.banner { + text-align: center; + color: blue; +} + + +pre { + font-family: courier new, courier, monospace; + color: #000000; + /* these will screw up Netscape 4.08 */ + /* border: solid; */ + /* border-color: white white white blue; */ + /* border-left: dashed red; */ + + } + +code { + font-family: courier new, courier, monospace; + /* font-size: 100%; */ + } + +div.footer { + align: center; + padding: .25em; + font-size: 10pt; +} + + +div.notice { + align: center; + padding: .25em; + border: dashed green; +} + +div.ad { + padding: .25em; + margin: .25em; + border: dashed red; + color: #000000; +} + +div.navbar { + align: center; + padding: .25em; + /* border: thin dashed blue; + color: blue; */ +} + +div.navbar { + text-align: center; +} + +div.navbar a { + text-decoration: none; + font-family: helvetica, arial, sans-serif; +} + + +div.toc a { + text-decoration: none; +} + + +div.search { + text-align: center; + padding: .25em; + #border: thin dashed blue; + # color: blue; +} + Index: /swishctl/doc/API.html =================================================================== --- /swishctl/doc/API.html (revision 1241) +++ /swishctl/doc/API.html (revision 1241) @@ -0,0 +1,131 @@ + + + SwishCtl - SWISH-E ActiveX API + + + + +

SwishCtl - SWISH-E ActiveX API

+ +
+ +
void swishctl.Init(str regkey)
+
+ swishctl.Init("IndexFiles") +

+ regkey specifies a string value under the + "HKLM\Software\SWISH-E Team\SwishCtl\Options" key + which is a space separated list of filenames. + Example: "IndexFiles" = "docs.idx help.idx" +

+

+ regkey is relative to the directory specified in + "HKLM\Software\SWISH-E Team\SwishCtl\Options\IndexLocation" + string value. + Example: "IndexLocation" = "c:\swishctl\" +

+
+ +
var swishctl.NewSearch( str query )
+
+ var res = swishctl.NewSearch( "test" ) +

+ query is equivalent to swish-e's -w command line option. + It is the full text of your query. It can be changed + later through swishctl.Execute. +

+
+ +
void swishctl.SetSort( str sort )
+
+ swishctl.SetSort("swishdocpath")
+ swishctl.SetSort("asc swishdocpath")
+ swishctl.SetSort("desc swishdocpath") +

+ sort order of search results. The string is a space + separated list of valid document properties. Each property + may contain a qualifier that sets the direction of the sort. +

+
+ +
str swishctl.Error()
+
+ alert( swishctl.Error() ) +

+ returns the text of the last SWISH-E error that occured; returns 0 if no errors. +

+
+ +
void swishctl.SetSearchLimit( str property, str low, str high )
+
+ swishctl.SetSearchLimit( "year", startyr, stopyr ) +

+ Sets a range from low to high inclusive that the given + property must be in to be selected as a result. + Call multiple times to set more than one limit + on different properties. Limits are ANDed, that is, a + result must be within the range of all limits specified + to be included in a list of results. +

+
+ +
void swishctl.Execute( str query )
+
+ swishctl.Execute( "some words" ) +

+ Executes a query based on the parameters in the + search object.query is an optional query string + to use for the search (query replaces the set query + string in the search object). +

+
+ +
int swishctl.Hits()
+
+

+ Returns the number of results for the query. If zero and no + errors were reported after calling swishctl.Execute then + the query returned zero results. +

+

+ +
void swishctl.SeekResult( int position )
+
+ swishctl.SeekResult( startresult - 1 ) +

+ Seeks to the position specified in the result + list. Zero is the first position and swishctl.Hits-1 + is the last position. Seeking past the end of results sets + a non-critical error condition. +

+
+ +
int swishctl.NextResult()
+
+

+ Fetches the next result from the list of results. Returns 0 if no more results are available. +

+
+ +
str swishctl.ResultPropertyString( str property )
+
+ swishctl.ResultPropertyString( "swishdocpath" ) +

+ Fetches the property specified for the current result. +

+
+ +
+ + + + + Index: /swishctl/src/StdAfx.h =================================================================== --- /swishctl/src/StdAfx.h (revision 1232) +++ /swishctl/src/StdAfx.h (revision 1232) @@ -0,0 +1,28 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#if !defined(AFX_STDAFX_H__9E204F24_4F04_11D7_858F_8CA08FF5860C__INCLUDED_) +#define AFX_STDAFX_H__9E204F24_4F04_11D7_858F_8CA08FF5860C__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define STRICT +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0400 +#endif +#define _ATL_APARTMENT_THREADED + +#include +//You may derive a class from CComModule and use it if you want to override +//something, but do not change the name of _Module +extern CComModule _Module; +#include +#include +#include +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__9E204F24_4F04_11D7_858F_8CA08FF5860C__INCLUDED) Index: /swishctl/src/SwishCtl.cpp =================================================================== --- /swishctl/src/SwishCtl.cpp (revision 1254) +++ /swishctl/src/SwishCtl.cpp (revision 1254) @@ -0,0 +1,220 @@ +/* + + * $Id$ + + * + + * SwishCtl - SWISH-E API ActiveX Control + + * Copyright (c) 2003 Peoples Resource Centre Wellington NZ + + * + + * This program is free software; you can redistribute it and/or modify + + * it under the terms of the GNU General Public License as published by + + * the Free Software Foundation; either version 2 of the License, or + + * (at your option) any later version. + + * + + * This program is distributed in the hope that it will be useful, + + * but WITHOUT ANY WARRANTY; without even the implied warranty of + + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + + * GNU General Public License for more details. + + * + + * You should have received a copy of the GNU General Public License + + * along with this program; if not, write to the Free Software + + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + */ + + + +// SwishCtl.cpp : Implementation of DLL Exports. + + + + + +// Note: Proxy/Stub Information + +// To build a separate proxy/stub DLL, + +// run nmake -f SwishCtlps.mk in the project directory. + + + +#include "stdafx.h" + +#include "resource.h" + +#include + +#include "SwishCtl.h" + + + +#include "SwishCtl_i.c" + +#include "swish-e.h" + + + +#include "CSwishCtl.h" + + + +CComModule _Module; + + + +BEGIN_OBJECT_MAP(ObjectMap) + +OBJECT_ENTRY(CLSID_CSwishCtl, CCSwishCtl) + +END_OBJECT_MAP() + + + + + +bool GetModulePath(char filename[ _MAX_PATH ]) + +{ + + + + DWORD result = GetModuleFileName( _Module.m_hInst, filename, _MAX_PATH ); + + if ( result > 0 ) { + + char drive [_MAX_DIR ]; + + char dir [_MAX_PATH ]; + + _splitpath( filename, drive, dir, NULL, NULL); + + _makepath( filename, drive, dir, NULL, NULL ); + + return true; + + } + + return false; + +} + + + +///////////////////////////////////////////////////////////////////////////// + +// DLL Entry Point + + + +extern "C" + +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) + +{ + + if (dwReason == DLL_PROCESS_ATTACH) + + { + + _Module.Init(ObjectMap, hInstance, &LIBID_SWISHCTLLib); + + DisableThreadLibraryCalls(hInstance); + + } + + else if (dwReason == DLL_PROCESS_DETACH) + + _Module.Term(); + + return TRUE; // ok + +} + + + +///////////////////////////////////////////////////////////////////////////// + +// Used to determine whether the DLL can be unloaded by OLE + + + +STDAPI DllCanUnloadNow(void) + +{ + + return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; + +} + + + +///////////////////////////////////////////////////////////////////////////// + +// Returns a class factory to create an object of the requested type + + + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) + +{ + + return _Module.GetClassObject(rclsid, riid, ppv); + +} + + + +///////////////////////////////////////////////////////////////////////////// + +// DllRegisterServer - Adds entries to the system registry + + + +STDAPI DllRegisterServer(void) + +{ + + // registers object, typelib and all interfaces in typelib + + + + return _Module.RegisterServer(TRUE); + +} + + + +///////////////////////////////////////////////////////////////////////////// + +// DllUnregisterServer - Removes entries from the system registry + + + +STDAPI DllUnregisterServer(void) + +{ + + return _Module.UnregisterServer(TRUE); + +} + + + + + Index: /swishctl/src/SwishCtl.plg =================================================================== --- /swishctl/src/SwishCtl.plg (revision 1232) +++ /swishctl/src/SwishCtl.plg (revision 1232) @@ -0,0 +1,38 @@ + + +
+

Build Log

+

+--------------------Configuration: SwishCtl - Win32 Release MinSize-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP15.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../swish-e/src/win32/libswishsearch.lib ../pcre/lib/libpcre.lib ../zlib/zlib.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"ReleaseMinSize/SwishCtl.pdb" /machine:I386 /def:".\SwishCtl.def" /out:"ReleaseMinSize/SwishCtl.dll" /implib:"ReleaseMinSize/SwishCtl.lib" +.\ReleaseMinSize\AnsiBSTR.obj +.\ReleaseMinSize\CSwishCtl.obj +.\ReleaseMinSize\regkey.obj +.\ReleaseMinSize\StdAfx.obj +.\ReleaseMinSize\SwishCtl.obj +.\ReleaseMinSize\SwishCtl.res +] +Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP15.tmp" +Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP16.bat" with contents +[ +@echo off +regsvr32 /s /c ".\ReleaseMinSize\SwishCtl.dll" +echo regsvr32 exec. time > ".\ReleaseMinSize\regsvr32.trg" +] +Creating command line "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP16.bat" +Linking... + Creating library ReleaseMinSize/SwishCtl.lib and object ReleaseMinSize/SwishCtl.exp +

Output Window

+Performing registration + + + +

Results

+SwishCtl.dll - 0 error(s), 0 warning(s) +
+ + Index: /swishctl/src/CSwishCtl.cpp =================================================================== --- /swishctl/src/CSwishCtl.cpp (revision 1287) +++ /swishctl/src/CSwishCtl.cpp (revision 1287) @@ -0,0 +1,751 @@ +/* + + * $Id$ + + * + + * SwishCtl - SWISH-E API ActiveX Control + + * Copyright (c) 2003 Peoples Resource Centre Wellington NZ + + * + + * This program is free software; you can redistribute it and/or modify + + * it under the terms of the GNU General Public License as published by + + * the Free Software Foundation; either version 2 of the License, or + + * (at your option) any later version. + + * + + * This program is distributed in the hope that it will be useful, + + * but WITHOUT ANY WARRANTY; without even the implied warranty of + + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + + * GNU General Public License for more details. + + * + + * You should have received a copy of the GNU General Public License + + * along with this program; if not, write to the Free Software + + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + */ + + + +// CSwishCtl.cpp : Implementation of CCSwishCtl + +// N.B. can't add swish-e/src to build settings for this project + +// because the folder contains a string.h which overrides the + +// default search location for string.h ! + +#include "stdafx.h" + +#include + +using namespace std; + + + +#include "swish-e.h" + +#include "SwishCtl.h" + +#include "CSwishCtl.h" + +#include "AnsiBSTR.h" + +#include "regkey.h" + + + +///////////////////////////////////////////////////////////////////////////// + +// CCSwishCtl + +CCSwishCtl::CCSwishCtl() + +{ + + swish_handle = NULL; + + swish_results = NULL; + + current_result = NULL; + +} + + + +CCSwishCtl::~CCSwishCtl(void) + +{ + + + + if ( swish_handle ) { + + SwishClose( swish_handle ); /* free the memory used */ + + } + +} + + + +// I didn't know where to put this prototype... + +// so it can go here for the meantime + +bool GetModulePath(char filename[ _MAX_PATH ]); + + + + + +STDMETHODIMP CCSwishCtl::Init(BSTR IndexFiles) + +{ + // In order to claim "safe for scripting", + // don't allow location of resources to be specified + // as a parameter - for this application, the dll must + // and the index files must reside in the same folder + // So now the IndexFiles parameter is the name of a + // registry value in the options key for this app + CAnsiStr bstr_indexfiles(IndexFiles); + + const char registrykey[] = "Software\\SWISH-E Team\\SwishCtl\\Options"; + + + RegKey hkcu(HKEY_LOCAL_MACHINE) ; + + + string indexfilepath; + + string indexfilename; + + + + + + if (hkcu.OpenKey( registrykey, KEY_QUERY_VALUE )) { + + indexfilepath = hkcu.QueryValue( "IndexLocation" ); + + indexfilename = hkcu.QueryValue( bstr_indexfiles.c_str() ); + + } + + + + + + chdir( indexfilepath.c_str() ); + + + + swish_handle = SwishInit((char *)indexfilename.c_str()); + + + + if ( ! swish_handle ) { + + ::MessageBox( NULL, "SwishInit call failed...", indexfilepath.c_str(), MB_OK ); + + return E_FAIL; + + } + + if ( SwishError( swish_handle ) ) { + + ::MessageBox( NULL, indexfilepath.c_str(), "Swish-e Index File error...", MB_OK ); + + + + SwishClose( swish_handle ); /* free the memory used */ + + return E_FAIL; + + } + + + + swish_search = NULL; + + + + return S_OK; + +} + + + + + +STDMETHODIMP CCSwishCtl::GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) + +{ + + ATLTRACE(_T("CObjectSafetyImpl::GetInterfaceSafetyOptions\n")); + + if (!pdwSupportedOptions || !pdwEnabledOptions) + + return E_FAIL; + + LPUNKNOWN pUnk; + + if (_InternalQueryInterface (riid, (void**)&pUnk) == E_NOINTERFACE) + + { + + // Our object doesn't even support this interface. + + return E_NOINTERFACE; + + } else { + + // Cleanup after ourselves. + + pUnk->Release(); + + pUnk = NULL; + + } + + if (riid == IID_IDispatch) { + + // IDispatch is an interface used for scripting. If your + + // control supports other IDispatch or Dual interfaces, you + + // may decide to add them here as well. Client wants to know + + // if object is safe for scripting. Only indicate safe for + + // scripting when the interface is safe. + + *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER; + + *pdwEnabledOptions = m_dwSafety & + + INTERFACESAFE_FOR_UNTRUSTED_CALLER; + + return S_OK; + + } else if ((riid == IID_IPersistStreamInit) || + + (riid == IID_IPersistStorage)) + + { + + // IID_IPersistStreamInit and IID_IPersistStorage are + + // interfaces used for Initialization. If your control + + // supports other Persistence interfaces, you may decide to + + // add them here as well. Client wants to know if object is + + // safe for initializing. Only indicate safe for initializing + + // when the interface is safe. + + *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA; + + *pdwEnabledOptions = m_dwSafety & + + INTERFACESAFE_FOR_UNTRUSTED_DATA; + + return S_OK; + + } else { + + // We are saying that no other interfaces in this control are + + // safe for initializing or scripting. + + *pdwSupportedOptions = 0; + + *pdwEnabledOptions = 0; + + return E_FAIL; + + } + +} + + + +STDMETHODIMP CCSwishCtl::SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) + +{ + + ATLTRACE(_T("CObjectSafetyImpl::SetInterfaceSafetyOptions\n")); + + if (!dwOptionSetMask && !dwEnabledOptions) return E_FAIL; + + + + LPUNKNOWN pUnk; + + if (_InternalQueryInterface (riid, (void**)&pUnk) == E_NOINTERFACE) + + { + + // Our object doesn't even support this interface. + + return E_NOINTERFACE; + + } else { + + // Cleanup after ourselves. + + pUnk->Release(); + + pUnk = NULL; + + } + + // Store our current safety level to return in + + // GetInterfaceSafetyOptions + + m_dwSafety |= dwEnabledOptions & dwOptionSetMask; + + if ((riid == IID_IDispatch) && + + (m_dwSafety & INTERFACESAFE_FOR_UNTRUSTED_CALLER)) + + { + + // Client wants us to disable any functionality that would + + // make the control unsafe for scripting. The same applies to + + // any other IDispatch or Dual interfaces your control may + + // support. Because our control is safe for scripting by + + // default we just return S_OK. + + return S_OK; + + } else if (((riid == IID_IPersistStreamInit) || + + (riid == IID_IPersistStorage)) && + + (m_dwSafety & INTERFACESAFE_FOR_UNTRUSTED_DATA)) + + { + + // Client wants us to make the control safe for initializing + + // from persistent data. For these interfaces, this control + + // is safe so we return S_OK. For Any interfaces that are not + + // safe, we would return E_FAIL. + + return S_OK; + + } else { + + // This control doesn't allow Initialization or Scripting + + // from any other interfaces so return E_FAIL. + + return E_FAIL; + + } + +} + + + + + +STDMETHODIMP CCSwishCtl::Error(int *errcode) + +{ + + *errcode = SwishError( swish_handle ); + + return S_OK; + +} + + + + + +STDMETHODIMP CCSwishCtl::Query(BSTR words, int *errcode) + +{ + + + + HRESULT hresult = NewSearch( words, errcode ); + + + + if ( hresult != S_OK ) return hresult; + + + + return Execute( NULL, errcode ); + +} + + + +STDMETHODIMP CCSwishCtl::ErrorString(BSTR *errstring) + +{ + + if ( ! swish_handle ) { + + return E_FAIL; + + } + + + + char *err = SwishErrorString(swish_handle); + + + + CAnsiBSTR bstrTemp( err ); + + + + if (!bstrTemp) + + return E_OUTOFMEMORY; + + + + *errstring = bstrTemp.Detach(); + + return S_OK; + +} + + + +STDMETHODIMP CCSwishCtl::Hits(int *hits) + +{ + + if (! swish_results ) return E_FAIL; + + *hits = SwishHits( swish_results ); + + return S_OK; + +} + + + +STDMETHODIMP CCSwishCtl::NextResult(int *more) + +{ + + *more = FALSE; + + if (!swish_results) return E_FAIL; + + + + current_result = SwishNextResult( swish_results ); + + if ( current_result ) *more = TRUE; + + + + return S_OK; + +} + + + + + +STDMETHODIMP CCSwishCtl::ResultPropertyString( + + BSTR propertyname, BSTR *result) + +{ + + + + + + CAnsiStr bstr_convert(propertyname); + + + + char *propertyval = SwishResultPropertyStr( + + current_result, bstr_convert.c_str()); + + + + CAnsiBSTR bstrTemp( propertyval ); + + + + if (!bstrTemp) + + return E_OUTOFMEMORY; + + + + *result = bstrTemp.Detach(); + + + + return S_OK; + + + +} + + + +STDMETHODIMP CCSwishCtl::Close() + +{ + + current_result = NULL; + + if ( swish_handle ) { + + if ( swish_results ) { + + Free_Results_Object( swish_results ); + + swish_results = NULL; + + } + + if (swish_search) { + + Free_Search_Object( swish_search ); + + swish_search = NULL; + + } + + SwishClose( swish_handle ); /* free the memory used */ + + swish_handle = NULL; + + } + + + + return S_OK; + +} + + + +STDMETHODIMP CCSwishCtl::SeekResult(int position, int *result) + +{ + + *result = -1; // an error + + if (!swish_results) return S_OK; + + + + *result = SwishSeekResult( swish_results, position ); + + + + return S_OK; + +} + + + +STDMETHODIMP CCSwishCtl::SetSort(BSTR sort) + +{ + + if ( ! (swish_handle && swish_search) ){ + + return E_FAIL; + + } + + + + CAnsiStr bstr_sort( sort ); + + + + SwishSetSort( swish_search, bstr_sort.c_str() ); + + + + return S_OK; + +} + + + + + +STDMETHODIMP CCSwishCtl::NewSearch(BSTR query, int *errcode) + +{ + + *errcode = -1; + + if ( ! swish_handle ) { + + ::MessageBox( NULL, "swish_handle is null...", "New Search", MB_OK ); + + return E_FAIL; + + } + + CAnsiStr bstr_query( query ); + + + + if ( swish_results ) { + + Free_Results_Object(swish_results); + + swish_results = NULL; + + } + + + + if ( swish_search ) { + + Free_Search_Object( swish_search ); + + } + + swish_search = New_Search_Object( swish_handle, bstr_query.c_str() ); + + + + + + SwishResetSearchLimit( swish_search ); + + + + if ( ! swish_search ) { + + ::MessageBox( NULL, "swish_search is null...", "Error", MB_OK ); + + } + + + + *errcode = SwishError( swish_handle ); + + + + return S_OK; + +} + + + +STDMETHODIMP CCSwishCtl::Execute(BSTR words, int *errcode) + +{ + + *errcode = -1; + + if ( ! swish_handle ) { + + + + return E_FAIL; + + } + + + + if ( !words ) { + + // use existing query string - no need to convert string + + swish_results = SwishExecute( swish_search, NULL ); + + *errcode = SwishError( swish_handle ); + + return S_OK; + + } + + CAnsiStr bstr_words( words ); + + swish_results = SwishExecute( swish_search, bstr_words.c_str() ); + + + + *errcode = SwishError( swish_handle ); + + + + return S_OK; + +} + + + + + + + +STDMETHODIMP CCSwishCtl::SetSearchLimit(BSTR propertyname, BSTR low, BSTR hi) + +{ + + if ( ! (swish_handle && swish_search) ){ + + return E_FAIL; + + } + + CAnsiStr bstr_propertyname(propertyname); + + CAnsiStr bstr_low(low); + + CAnsiStr bstr_hi(hi); + + + + SwishSetSearchLimit( swish_search, + + bstr_propertyname.c_str(), + + bstr_low.c_str(), + + bstr_hi.c_str() ); + + return S_OK; + +} + + + Index: /swishctl/src/SwishCtl.dsp =================================================================== --- /swishctl/src/SwishCtl.dsp (revision 1559) +++ /swishctl/src/SwishCtl.dsp (revision 1559) @@ -0,0 +1,158 @@ +# Microsoft Developer Studio Project File - Name="SwishCtl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=SwishCtl - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "SwishCtl.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "SwishCtl.mak" CFG="SwishCtl - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "SwishCtl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "SwishCtl - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "SwishCtl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\swish-e\src\Win32" /D "HAVE_CONFIG_H" /D "HAVE_ZLIB" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /GZ /c +# ADD BASE RSC /l 0x1409 /d "_DEBUG" +# ADD RSC /l 0x1409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib ../../swish-e/src/win32/libswish-e.lib ../../zlib/lib/zlib.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept + +!ELSEIF "$(CFG)" == "SwishCtl - Win32 Release MinSize" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseMinSize" +# PROP BASE Intermediate_Dir "ReleaseMinSize" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseMinSize" +# PROP Intermediate_Dir "ReleaseMinSize" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /I "..\..\swish-e\src" /I "..\dev\swish-e\src" /D "HAVE_CONFIG_H" /D "HAVE_ZLIB" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /Yu"stdafx.h" /FD /c +# ADD BASE RSC /l 0x1409 /d "NDEBUG" +# ADD RSC /l 0x1409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib ../../swish-e/src/win32/libswish-e.lib ../../zlib/lib/zlib.lib /nologo /subsystem:windows /dll /machine:I386 /out:"../SwishCtl.dll" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "SwishCtl - Win32 Debug" +# Name "SwishCtl - Win32 Release MinSize" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\AnsiBSTR.cpp +# End Source File +# Begin Source File + +SOURCE=.\CSwishCtl.cpp +# End Source File +# Begin Source File + +SOURCE=.\regkey.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\SwishCtl.cpp +# End Source File +# Begin Source File + +SOURCE=.\SwishCtl.def +# End Source File +# Begin Source File + +SOURCE=.\SwishCtl.idl +# ADD MTL /tlb ".\SwishCtl.tlb" /h "SwishCtl.h" /iid "SwishCtl_i.c" /Oicf +# End Source File +# Begin Source File + +SOURCE=.\SwishCtl.rc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\AnsiBSTR.h +# End Source File +# Begin Source File + +SOURCE=.\CSwishCtl.h +# End Source File +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# Begin Source File + +SOURCE=.\SwishCtl.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\CSwishCtl.rgs +# End Source File +# End Group +# End Target +# End Project Index: /swishctl/src/dlldata.c =================================================================== --- /swishctl/src/dlldata.c (revision 1232) +++ /swishctl/src/dlldata.c (revision 1232) @@ -0,0 +1,38 @@ +/********************************************************* + DllData file -- generated by MIDL compiler + + DO NOT ALTER THIS FILE + + This file is regenerated by MIDL on every IDL file compile. + + To completely reconstruct this file, delete it and rerun MIDL + on all the IDL files in this DLL, specifying this file for the + /dlldata command line option + +*********************************************************/ + +#define PROXY_DELEGATION + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN_PROXY_FILE( SwishCtl ) + + +PROXYFILE_LIST_START +/* Start of list */ + REFERENCE_PROXY_FILE( SwishCtl ), +/* End of list */ +PROXYFILE_LIST_END + + +DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID ) + +#ifdef __cplusplus +} /*extern "C" */ +#endif + +/* end of generated dlldata file */ Index: /swishctl/src/CSwishCtl.h =================================================================== --- /swishctl/src/CSwishCtl.h (revision 1232) +++ /swishctl/src/CSwishCtl.h (revision 1232) @@ -0,0 +1,57 @@ +// CSwishCtl.h : Declaration of the CCSwishCtl + +#ifndef __CSWISHCTL_H_ +#define __CSWISHCTL_H_ + +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CCSwishCtl +class ATL_NO_VTABLE CCSwishCtl : + public CComObjectRootEx, + public CComCoClass, + public IDispatchImpl, + public IObjectSafetyImpl // ATL's version of IObjectSafety +{ +public: + CCSwishCtl(); + ~CCSwishCtl(); + + + +DECLARE_REGISTRY_RESOURCEID(IDR_CSWISHCTL) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CCSwishCtl) + COM_INTERFACE_ENTRY(ICSwishCtl) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(IObjectSafety) // Tie IObjectSafety to this COM map +END_COM_MAP() + +// ICSwishCtl +public: + STDMETHOD(SetSearchLimit)(/*[in]*/ BSTR propertyname, /*[in]*/ BSTR low, /*[in]*/ BSTR hi); + STDMETHOD(Execute)(/*[in]*/ BSTR words, /*[out,retval]*/ int *errcode); + STDMETHOD(NewSearch)(/*[in]*/ BSTR query, /*[out,retval]*/ int *errcode); + STDMETHOD(SetSort)(/*[in]*/ BSTR sort); + STDMETHOD(SeekResult)(/*[in]*/ int position, /*[out,retval]*/ int *result); + STDMETHOD(Close)(); + STDMETHOD(ResultPropertyString)(/*[in]*/ BSTR propertyname, /*[out,retval]*/ BSTR *result); + STDMETHOD(NextResult)(/*[out,retval]*/ int *more); + STDMETHOD(Hits)(/*[out,retval]*/ int *hits); + STDMETHOD(ErrorString)(/*[out,retval]*/ BSTR *errstring); + STDMETHOD(Query)(/*[in]*/ BSTR words, /*[out,retval]*/ int *errcode); + STDMETHOD(Error)(/*[out,retval]*/ int *errcode); + STDMETHOD(Init)(BSTR IndexFiles); + DWORD m_dwSafety; + STDMETHOD (SetInterfaceSafetyOptions)(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions); + STDMETHOD (GetInterfaceSafetyOptions)(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions); +private: + SW_SEARCH swish_search; + SW_RESULT current_result; + SW_RESULTS swish_results; + SW_HANDLE swish_handle; +}; + +#endif //__CSWISHCTL_H_ Index: /swishctl/src/SwishCtl.dsw =================================================================== --- /swishctl/src/SwishCtl.dsw (revision 1254) +++ /swishctl/src/SwishCtl.dsw (revision 1254) @@ -0,0 +1,82 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 + +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + + + +############################################################################### + + + +Project: "SwishCtl"=.\SwishCtl.dsp - Package Owner=<4> + + + +Package=<5> + +{{{ + +}}} + + + +Package=<4> + +{{{ + +}}} + + + +############################################################################### + + + +Project: "setup"=.\setup\setup.dsp - Package Owner=<4> + + + +Package=<5> + +{{{ + +}}} + + + +Package=<4> + +{{{ + +}}} + + + +############################################################################### + + + +Global: + + + +Package=<5> + +{{{ + +}}} + + + +Package=<3> + +{{{ + +}}} + + + +############################################################################### + + + Index: /swishctl/src/SwishCtl.def =================================================================== --- /swishctl/src/SwishCtl.def (revision 1232) +++ /swishctl/src/SwishCtl.def (revision 1232) @@ -0,0 +1,9 @@ +; SwishCtl.def : Declares the module parameters. + +LIBRARY "SwishCtl.DLL" + +EXPORTS + DllCanUnloadNow @1 PRIVATE + DllGetClassObject @2 PRIVATE + DllRegisterServer @3 PRIVATE + DllUnregisterServer @4 PRIVATE Index: /swishctl/src/CSwishCtl.rgs =================================================================== --- /swishctl/src/CSwishCtl.rgs (revision 1232) +++ /swishctl/src/CSwishCtl.rgs (revision 1232) @@ -0,0 +1,26 @@ +HKCR +{ + SwishCtl.CSwishCtl.1 = s 'CSwishCtl Class' + { + CLSID = s '{9E204F2E-4F04-11D7-858F-8CA08FF5860C}' + } + SwishCtl.CSwishCtl = s 'CSwishCtl Class' + { + CLSID = s '{9E204F2E-4F04-11D7-858F-8CA08FF5860C}' + CurVer = s 'SwishCtl.CSwishCtl.1' + } + NoRemove CLSID + { + ForceRemove {9E204F2E-4F04-11D7-858F-8CA08FF5860C} = s 'CSwishCtl Class' + { + ProgID = s 'SwishCtl.CSwishCtl.1' + VersionIndependentProgID = s 'SwishCtl.CSwishCtl' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + 'TypeLib' = s '{9E204F21-4F04-11D7-858F-8CA08FF5860C}' + } + } +} Index: /swishctl/src/SwishCtl_p.c =================================================================== --- /swishctl/src/SwishCtl_p.c (revision 1232) +++ /swishctl/src/SwishCtl_p.c (revision 1232) @@ -0,0 +1,884 @@ +/* this ALWAYS GENERATED file contains the proxy stub code */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Fri May 23 23:23:35 2003 + */ +/* Compiler settings for C:\projects\swish\win32\swishctl\SwishCtl.idl: + Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) + +#define USE_STUBLESS_PROXY + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REDQ_RPCPROXY_H_VERSION__ +#define __REQUIRED_RPCPROXY_H_VERSION__ 440 +#endif + + +#include "rpcproxy.h" +#ifndef __RPCPROXY_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCPROXY_H_VERSION__ + + +#include "SwishCtl.h" + +#define TYPE_FORMAT_STRING_SIZE 59 +#define PROC_FORMAT_STRING_SIZE 401 + +typedef struct _MIDL_TYPE_FORMAT_STRING + { + short Pad; + unsigned char Format[ TYPE_FORMAT_STRING_SIZE ]; + } MIDL_TYPE_FORMAT_STRING; + +typedef struct _MIDL_PROC_FORMAT_STRING + { + short Pad; + unsigned char Format[ PROC_FORMAT_STRING_SIZE ]; + } MIDL_PROC_FORMAT_STRING; + + +extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString; +extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString; + + +/* Object interface: IUnknown, ver. 0.0, + GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */ + + +/* Object interface: IDispatch, ver. 0.0, + GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */ + + +/* Object interface: ICSwishCtl, ver. 0.0, + GUID={0x9E204F2D,0x4F04,0x11D7,{0x85,0x8F,0x8C,0xA0,0x8F,0xF5,0x86,0x0C}} */ + + +extern const MIDL_STUB_DESC Object_StubDesc; + + +extern const MIDL_SERVER_INFO ICSwishCtl_ServerInfo; + +#pragma code_seg(".orpc") +extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1]; + +static const MIDL_STUB_DESC Object_StubDesc = + { + 0, + NdrOleAllocate, + NdrOleFree, + 0, + 0, + 0, + 0, + 0, + __MIDL_TypeFormatString.Format, + 1, /* -error bounds_check flag */ + 0x20000, /* Ndr library version */ + 0, + 0x50100a4, /* MIDL Version 5.1.164 */ + 0, + UserMarshalRoutines, + 0, /* notify & notify_flag routine table */ + 1, /* Flags */ + 0, /* Reserved3 */ + 0, /* Reserved4 */ + 0 /* Reserved5 */ + }; + +static const unsigned short ICSwishCtl_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 28, + 56, + 90, + 118, + 146, + 174, + 208, + 230, + 264, + 292, + 326, + 360 + }; + +static const MIDL_SERVER_INFO ICSwishCtl_ServerInfo = + { + &Object_StubDesc, + 0, + __MIDL_ProcFormatString.Format, + &ICSwishCtl_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0 + }; + +static const MIDL_STUBLESS_PROXY_INFO ICSwishCtl_ProxyInfo = + { + &Object_StubDesc, + __MIDL_ProcFormatString.Format, + &ICSwishCtl_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + +CINTERFACE_PROXY_VTABLE(20) _ICSwishCtlProxyVtbl = +{ + &ICSwishCtl_ProxyInfo, + &IID_ICSwishCtl, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ , + 0 /* (void *)-1 /* IDispatch::GetTypeInfo */ , + 0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *)-1 /* ICSwishCtl::Init */ , + (void *)-1 /* ICSwishCtl::Error */ , + (void *)-1 /* ICSwishCtl::Query */ , + (void *)-1 /* ICSwishCtl::ErrorString */ , + (void *)-1 /* ICSwishCtl::Hits */ , + (void *)-1 /* ICSwishCtl::NextResult */ , + (void *)-1 /* ICSwishCtl::ResultPropertyString */ , + (void *)-1 /* ICSwishCtl::Close */ , + (void *)-1 /* ICSwishCtl::SeekResult */ , + (void *)-1 /* ICSwishCtl::SetSort */ , + (void *)-1 /* ICSwishCtl::NewSearch */ , + (void *)-1 /* ICSwishCtl::Execute */ , + (void *)-1 /* ICSwishCtl::SetSearchLimit */ +}; + + +static const PRPC_STUB_FUNCTION ICSwishCtl_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _ICSwishCtlStubVtbl = +{ + &IID_ICSwishCtl, + &ICSwishCtl_ServerInfo, + 20, + &ICSwishCtl_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + +#pragma data_seg(".rdata") + +static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1] = + { + + { + BSTR_UserSize + ,BSTR_UserMarshal + ,BSTR_UserUnmarshal + ,BSTR_UserFree + } + + }; + + +#if !defined(__RPC_WIN32__) +#error Invalid build platform for this stub. +#endif + +#if !(TARGET_IS_NT40_OR_LATER) +#error You need a Windows NT 4.0 or later to run this stub because it uses these features: +#error -Oif or -Oicf, [wire_marshal] or [user_marshal] attribute, more than 32 methods in the interface. +#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems. +#error This app will die there with the RPC_X_WRONG_STUB_VERSION error. +#endif + + +static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = + { + 0, + { + + /* Procedure Init */ + + 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 2 */ NdrFcLong( 0x0 ), /* 0 */ +/* 6 */ NdrFcShort( 0x7 ), /* 7 */ +#ifndef _ALPHA_ +/* 8 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 10 */ NdrFcShort( 0x0 ), /* 0 */ +/* 12 */ NdrFcShort( 0x8 ), /* 8 */ +/* 14 */ 0x6, /* Oi2 Flags: clt must size, has return, */ + 0x2, /* 2 */ + + /* Parameter IndexFiles */ + +/* 16 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 18 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 20 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Return value */ + +/* 22 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 24 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 26 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure Error */ + +/* 28 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 30 */ NdrFcLong( 0x0 ), /* 0 */ +/* 34 */ NdrFcShort( 0x8 ), /* 8 */ +#ifndef _ALPHA_ +/* 36 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 38 */ NdrFcShort( 0x0 ), /* 0 */ +/* 40 */ NdrFcShort( 0x10 ), /* 16 */ +/* 42 */ 0x4, /* Oi2 Flags: has return, */ + 0x2, /* 2 */ + + /* Parameter errcode */ + +/* 44 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 46 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 48 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + +/* 50 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 52 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 54 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure Query */ + +/* 56 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 58 */ NdrFcLong( 0x0 ), /* 0 */ +/* 62 */ NdrFcShort( 0x9 ), /* 9 */ +#ifndef _ALPHA_ +/* 64 */ NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */ +#else + NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */ +#endif +/* 66 */ NdrFcShort( 0x0 ), /* 0 */ +/* 68 */ NdrFcShort( 0x10 ), /* 16 */ +/* 70 */ 0x6, /* Oi2 Flags: clt must size, has return, */ + 0x3, /* 3 */ + + /* Parameter words */ + +/* 72 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 74 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 76 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Parameter errcode */ + +/* 78 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 80 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 82 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + +/* 84 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 86 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 88 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure ErrorString */ + +/* 90 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 92 */ NdrFcLong( 0x0 ), /* 0 */ +/* 96 */ NdrFcShort( 0xa ), /* 10 */ +#ifndef _ALPHA_ +/* 98 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 100 */ NdrFcShort( 0x0 ), /* 0 */ +/* 102 */ NdrFcShort( 0x8 ), /* 8 */ +/* 104 */ 0x5, /* Oi2 Flags: srv must size, has return, */ + 0x2, /* 2 */ + + /* Parameter errstring */ + +/* 106 */ NdrFcShort( 0x2113 ), /* Flags: must size, must free, out, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 108 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 110 */ NdrFcShort( 0x30 ), /* Type Offset=48 */ + + /* Return value */ + +/* 112 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 114 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 116 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure Hits */ + +/* 118 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 120 */ NdrFcLong( 0x0 ), /* 0 */ +/* 124 */ NdrFcShort( 0xb ), /* 11 */ +#ifndef _ALPHA_ +/* 126 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 128 */ NdrFcShort( 0x0 ), /* 0 */ +/* 130 */ NdrFcShort( 0x10 ), /* 16 */ +/* 132 */ 0x4, /* Oi2 Flags: has return, */ + 0x2, /* 2 */ + + /* Parameter hits */ + +/* 134 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 136 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 138 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + +/* 140 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 142 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 144 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure NextResult */ + +/* 146 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 148 */ NdrFcLong( 0x0 ), /* 0 */ +/* 152 */ NdrFcShort( 0xc ), /* 12 */ +#ifndef _ALPHA_ +/* 154 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 156 */ NdrFcShort( 0x0 ), /* 0 */ +/* 158 */ NdrFcShort( 0x10 ), /* 16 */ +/* 160 */ 0x4, /* Oi2 Flags: has return, */ + 0x2, /* 2 */ + + /* Parameter more */ + +/* 162 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 164 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 166 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + +/* 168 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 170 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 172 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure ResultPropertyString */ + +/* 174 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 176 */ NdrFcLong( 0x0 ), /* 0 */ +/* 180 */ NdrFcShort( 0xd ), /* 13 */ +#ifndef _ALPHA_ +/* 182 */ NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */ +#else + NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */ +#endif +/* 184 */ NdrFcShort( 0x0 ), /* 0 */ +/* 186 */ NdrFcShort( 0x8 ), /* 8 */ +/* 188 */ 0x7, /* Oi2 Flags: srv must size, clt must size, has return, */ + 0x3, /* 3 */ + + /* Parameter propertyname */ + +/* 190 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 192 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 194 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Parameter result */ + +/* 196 */ NdrFcShort( 0x2113 ), /* Flags: must size, must free, out, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 198 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 200 */ NdrFcShort( 0x30 ), /* Type Offset=48 */ + + /* Return value */ + +/* 202 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 204 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 206 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure Close */ + +/* 208 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 210 */ NdrFcLong( 0x0 ), /* 0 */ +/* 214 */ NdrFcShort( 0xe ), /* 14 */ +#ifndef _ALPHA_ +/* 216 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 218 */ NdrFcShort( 0x0 ), /* 0 */ +/* 220 */ NdrFcShort( 0x8 ), /* 8 */ +/* 222 */ 0x4, /* Oi2 Flags: has return, */ + 0x1, /* 1 */ + + /* Return value */ + +/* 224 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 226 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 228 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure SeekResult */ + +/* 230 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 232 */ NdrFcLong( 0x0 ), /* 0 */ +/* 236 */ NdrFcShort( 0xf ), /* 15 */ +#ifndef _ALPHA_ +/* 238 */ NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */ +#else + NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */ +#endif +/* 240 */ NdrFcShort( 0x8 ), /* 8 */ +/* 242 */ NdrFcShort( 0x10 ), /* 16 */ +/* 244 */ 0x4, /* Oi2 Flags: has return, */ + 0x3, /* 3 */ + + /* Parameter position */ + +/* 246 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +#ifndef _ALPHA_ +/* 248 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 250 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter result */ + +/* 252 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 254 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 256 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + +/* 258 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 260 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 262 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure SetSort */ + +/* 264 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 266 */ NdrFcLong( 0x0 ), /* 0 */ +/* 270 */ NdrFcShort( 0x10 ), /* 16 */ +#ifndef _ALPHA_ +/* 272 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 274 */ NdrFcShort( 0x0 ), /* 0 */ +/* 276 */ NdrFcShort( 0x8 ), /* 8 */ +/* 278 */ 0x6, /* Oi2 Flags: clt must size, has return, */ + 0x2, /* 2 */ + + /* Parameter sort */ + +/* 280 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 282 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 284 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Return value */ + +/* 286 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 288 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 290 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure NewSearch */ + +/* 292 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 294 */ NdrFcLong( 0x0 ), /* 0 */ +/* 298 */ NdrFcShort( 0x11 ), /* 17 */ +#ifndef _ALPHA_ +/* 300 */ NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */ +#else + NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */ +#endif +/* 302 */ NdrFcShort( 0x0 ), /* 0 */ +/* 304 */ NdrFcShort( 0x10 ), /* 16 */ +/* 306 */ 0x6, /* Oi2 Flags: clt must size, has return, */ + 0x3, /* 3 */ + + /* Parameter query */ + +/* 308 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 310 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 312 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Parameter errcode */ + +/* 314 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 316 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 318 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + +/* 320 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 322 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 324 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure Execute */ + +/* 326 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 328 */ NdrFcLong( 0x0 ), /* 0 */ +/* 332 */ NdrFcShort( 0x12 ), /* 18 */ +#ifndef _ALPHA_ +/* 334 */ NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */ +#else + NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */ +#endif +/* 336 */ NdrFcShort( 0x0 ), /* 0 */ +/* 338 */ NdrFcShort( 0x10 ), /* 16 */ +/* 340 */ 0x6, /* Oi2 Flags: clt must size, has return, */ + 0x3, /* 3 */ + + /* Parameter words */ + +/* 342 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 344 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 346 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Parameter errcode */ + +/* 348 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +#ifndef _ALPHA_ +/* 350 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 352 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + +/* 354 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 356 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 358 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure SetSearchLimit */ + +/* 360 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 362 */ NdrFcLong( 0x0 ), /* 0 */ +/* 366 */ NdrFcShort( 0x13 ), /* 19 */ +#ifndef _ALPHA_ +/* 368 */ NdrFcShort( 0x14 ), /* x86, MIPS, PPC Stack size/offset = 20 */ +#else + NdrFcShort( 0x28 ), /* Alpha Stack size/offset = 40 */ +#endif +/* 370 */ NdrFcShort( 0x0 ), /* 0 */ +/* 372 */ NdrFcShort( 0x8 ), /* 8 */ +/* 374 */ 0x6, /* Oi2 Flags: clt must size, has return, */ + 0x4, /* 4 */ + + /* Parameter propertyname */ + +/* 376 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 378 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */ +#else + NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ +#endif +/* 380 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Parameter low */ + +/* 382 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 384 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */ +#else + NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */ +#endif +/* 386 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Parameter hi */ + +/* 388 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */ +#ifndef _ALPHA_ +/* 390 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */ +#else + NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ +#endif +/* 392 */ NdrFcShort( 0x1a ), /* Type Offset=26 */ + + /* Return value */ + +/* 394 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +#ifndef _ALPHA_ +/* 396 */ NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */ +#else + NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */ +#endif +/* 398 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + 0x0 + } + }; + +static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = + { + 0, + { + NdrFcShort( 0x0 ), /* 0 */ +/* 2 */ + 0x12, 0x0, /* FC_UP */ +/* 4 */ NdrFcShort( 0xc ), /* Offset= 12 (16) */ +/* 6 */ + 0x1b, /* FC_CARRAY */ + 0x1, /* 1 */ +/* 8 */ NdrFcShort( 0x2 ), /* 2 */ +/* 10 */ 0x9, /* Corr desc: FC_ULONG */ + 0x0, /* */ +/* 12 */ NdrFcShort( 0xfffc ), /* -4 */ +/* 14 */ 0x6, /* FC_SHORT */ + 0x5b, /* FC_END */ +/* 16 */ + 0x17, /* FC_CSTRUCT */ + 0x3, /* 3 */ +/* 18 */ NdrFcShort( 0x8 ), /* 8 */ +/* 20 */ NdrFcShort( 0xfffffff2 ), /* Offset= -14 (6) */ +/* 22 */ 0x8, /* FC_LONG */ + 0x8, /* FC_LONG */ +/* 24 */ 0x5c, /* FC_PAD */ + 0x5b, /* FC_END */ +/* 26 */ 0xb4, /* FC_USER_MARSHAL */ + 0x83, /* 131 */ +/* 28 */ NdrFcShort( 0x0 ), /* 0 */ +/* 30 */ NdrFcShort( 0x4 ), /* 4 */ +/* 32 */ NdrFcShort( 0x0 ), /* 0 */ +/* 34 */ NdrFcShort( 0xffffffe0 ), /* Offset= -32 (2) */ +/* 36 */ + 0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */ +/* 38 */ 0x8, /* FC_LONG */ + 0x5c, /* FC_PAD */ +/* 40 */ + 0x11, 0x4, /* FC_RP [alloced_on_stack] */ +/* 42 */ NdrFcShort( 0x6 ), /* Offset= 6 (48) */ +/* 44 */ + 0x13, 0x0, /* FC_OP */ +/* 46 */ NdrFcShort( 0xffffffe2 ), /* Offset= -30 (16) */ +/* 48 */ 0xb4, /* FC_USER_MARSHAL */ + 0x83, /* 131 */ +/* 50 */ NdrFcShort( 0x0 ), /* 0 */ +/* 52 */ NdrFcShort( 0x4 ), /* 4 */ +/* 54 */ NdrFcShort( 0x0 ), /* 0 */ +/* 56 */ NdrFcShort( 0xfffffff4 ), /* Offset= -12 (44) */ + + 0x0 + } + }; + +const CInterfaceProxyVtbl * _SwishCtl_ProxyVtblList[] = +{ + ( CInterfaceProxyVtbl *) &_ICSwishCtlProxyVtbl, + 0 +}; + +const CInterfaceStubVtbl * _SwishCtl_StubVtblList[] = +{ + ( CInterfaceStubVtbl *) &_ICSwishCtlStubVtbl, + 0 +}; + +PCInterfaceName const _SwishCtl_InterfaceNamesList[] = +{ + "ICSwishCtl", + 0 +}; + +const IID * _SwishCtl_BaseIIDList[] = +{ + &IID_IDispatch, + 0 +}; + + +#define _SwishCtl_CHECK_IID(n) IID_GENERIC_CHECK_IID( _SwishCtl, pIID, n) + +int __stdcall _SwishCtl_IID_Lookup( const IID * pIID, int * pIndex ) +{ + + if(!_SwishCtl_CHECK_IID(0)) + { + *pIndex = 0; + return 1; + } + + return 0; +} + +const ExtendedProxyFileInfo SwishCtl_ProxyFileInfo = +{ + (PCInterfaceProxyVtblList *) & _SwishCtl_ProxyVtblList, + (PCInterfaceStubVtblList *) & _SwishCtl_StubVtblList, + (const PCInterfaceName * ) & _SwishCtl_InterfaceNamesList, + (const IID ** ) & _SwishCtl_BaseIIDList, + & _SwishCtl_IID_Lookup, + 1, + 2, + 0, /* table of [async_uuid] interfaces */ + 0, /* Filler1 */ + 0, /* Filler2 */ + 0 /* Filler3 */ +}; Index: /swishctl/src/SwishCtlps.def =================================================================== --- /swishctl/src/SwishCtlps.def (revision 1232) +++ /swishctl/src/SwishCtlps.def (revision 1232) @@ -0,0 +1,11 @@ + +LIBRARY "SwishCtlPS" + +DESCRIPTION 'Proxy/Stub DLL' + +EXPORTS + DllGetClassObject @1 PRIVATE + DllCanUnloadNow @2 PRIVATE + GetProxyDllInfo @3 PRIVATE + DllRegisterServer @4 PRIVATE + DllUnregisterServer @5 PRIVATE Index: /swishctl/src/paths.cpp =================================================================== --- /swishctl/src/paths.cpp (revision 1232) +++ /swishctl/src/paths.cpp (revision 1232) @@ -0,0 +1,9 @@ +// paths.cpp + +#include "stdafx.h" +#include "resource.h" +#include "paths.h" + +#include + +using namespace std; Index: /swishctl/src/setup/StdAfx.h =================================================================== --- /swishctl/src/setup/StdAfx.h (revision 1232) +++ /swishctl/src/setup/StdAfx.h (revision 1232) @@ -0,0 +1,35 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) +#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + + +// Windows Header Files: +#include + +// C RunTime Header Files +#include +#include +#include +#include + +// Local Header Files + +// TODO: reference additional headers your program requires here +#include +#include +#include + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) Index: /swishctl/src/setup/stringbuffer.cpp =================================================================== --- /swishctl/src/setup/stringbuffer.cpp (revision 1232) +++ /swishctl/src/setup/stringbuffer.cpp (revision 1232) @@ -0,0 +1,20 @@ +// stringbuffer.cpp: implementation of the stringbuffer class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "stringbuffer.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +stringbuffer::stringbuffer() +{ + +} + +stringbuffer::~stringbuffer() +{ + +} Index: /swishctl/src/setup/setup.plg =================================================================== --- /swishctl/src/setup/setup.plg (revision 1232) +++ /swishctl/src/setup/setup.plg (revision 1232) @@ -0,0 +1,31 @@ + + +
+

Build Log

+

+--------------------Configuration: setup - Win32 Release-------------------- +

+

Command Lines

+Creating command line "rc.exe /l 0x1409 /fo"Release/setup.res" /d "NDEBUG" "C:\dev\SwishCtl\setup\setup.rc"" +Creating temporary file "D:\DOCUME~1\GREG~1.BUT\LOCALS~1\Temp\RSP103.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib version.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/setup.pdb" /machine:I386 /out:"../Release/setup.exe" +.\Release\paths.obj +.\Release\regkey.obj +.\Release\setup.obj +.\Release\StdAfx.obj +.\Release\stringbuffer.obj +.\Release\setup.res +] +Creating command line "link.exe @D:\DOCUME~1\GREG~1.BUT\LOCALS~1\Temp\RSP103.tmp" +

Output Window

+Compiling resources... +Linking... + + + +

Results

+setup.exe - 0 error(s), 0 warning(s) +
+ + Index: /swishctl/src/setup/setup.cpp =================================================================== --- /swishctl/src/setup/setup.cpp (revision 1255) +++ /swishctl/src/setup/setup.cpp (revision 1255) @@ -0,0 +1,782 @@ +// setup.cpp : Defines the entry point for the application. +// +#include "stdafx.h" +#include "resource.h" +#include + +#include "paths.h" + +using namespace std; + +#include "../regkey.h" + +// One day I'll get around to doing the +// ugly GetFileVersion code... +#define SWISHCTL_VERSION ("1007") + +const char *AUTORUN = "AutoRun"; + +// Global Variables: +enum dllnames { SWISHCTL=0, ZLIB=1 }; + + +// Names of files to be installed in System directory +char * installdlls[] = { + "SwishCtl.dll", "zlib.dll" }; + +const char registrykey[] = "Software\\SWISH-E Team\\SwishCtl\\Options"; + +static const char uninstallkey[] = + "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" ; + + +// Foward declarations of functions included in this code module: +LRESULT CALLBACK SetupHandler(HWND, UINT, WPARAM, LPARAM); + + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * class SetupApp manages application instance data + * and Ole initialisation + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +class SetupApp { +public: + static HINSTANCE getInstance() {return hInst;}; + ~SetupApp(); + SetupApp(HINSTANCE hInstance); + static HINSTANCE hInst; // current instance + +}; + +SetupApp::SetupApp(HINSTANCE hInstance) +{ + hInst = hInstance; // Store instance handle in our global variable + OleInitialize(NULL); + +} + +SetupApp::~SetupApp() +{ + OleUninitialize(); +} + +HINSTANCE SetupApp::hInst = 0; // static instance variable + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * end of Setup App class + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * LibModule class + * encapsulates instance loaded with LoadLibrary + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +class LibModule { +public: + LibModule() {m_hLib = NULL;}; + ~LibModule(); + bool LoadLibrary( const char *pathname ); + HINSTANCE getInstance(){ return m_hLib;}; + +private: + HINSTANCE m_hLib; +}; + +LibModule::~LibModule() +{ + if (m_hLib) ::FreeLibrary(m_hLib); //ensure FreeLibrary gets called +} + +bool LibModule::LoadLibrary( const char *pathname ) +{ + m_hLib = ::LoadLibrary(pathname); + return m_hLib != NULL; +} +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * end of LibModule class + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + + +typedef enum InstallResult { INSTALL_OK, ERR_INUSE, ERR_FAIL, ERR_ONREBOOT }; + + +// Add a new Folder (FolderName) to Start | Programs +// appends the Programs folder path to give FullPathToFolder +// Make sure FullPathToFolder is big enough to hold the path +bool AddStartProgramsFolder(char *FolderName, char *FullPathToFolder) +{ + LPITEMIDLIST pidlPrograms; + + //get the pidl for Start|Programs + SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlPrograms); + + if ( !SHGetPathFromIDList( pidlPrograms, FullPathToFolder) ) + { + return false; + } + + strcat( FullPathToFolder, FolderName); + //create the folder + CreateDirectory(FullPathToFolder, NULL); + SHChangeNotify(SHCNE_MKDIR, SHCNF_PATH, FullPathToFolder, 0); + + return true; +} + + +HRESULT CreateShortcut( LPCSTR Source, + LPSTR Target, + LPSTR Description) +{ + HRESULT hresult; + IShellLink* ShellLink; + + //CoInitialize must be called before this + // Get a pointer to the IShellLink interface. + hresult = CoCreateInstance( + CLSID_ShellLink, + NULL, + CLSCTX_INPROC_SERVER, + IID_IShellLink, + (LPVOID*)&ShellLink); + if (SUCCEEDED(hresult)) + { + IPersistFile* PersistFile; + + // Set the path to the shortcut target, and add the description. + ShellLink->SetPath(Source); + ShellLink->SetDescription(Description); + + // Query IShellLink for the IPersistFile interface for saving the + // shortcut in persistent storage. + hresult = ShellLink->QueryInterface(IID_IPersistFile, (LPVOID*)&PersistFile); + + if (SUCCEEDED(hresult)) + { + WCHAR WideTarget[MAX_PATH]; + + // Ensure that the string is ANSI. + MultiByteToWideChar( CP_ACP, + 0, + Target, + -1, + WideTarget, + MAX_PATH); + + // Save the link by calling IPersistFile::Save. + hresult = PersistFile->Save(WideTarget, TRUE); + + + PersistFile->Release(); + } + + ShellLink->Release(); + } + + return hresult; +} + +// Remove the SwishCtl key from the registry +// should remove the "SWISH-E Team" key if it is empty +bool UnregisterIndexFile() +{ + RegKey key(HKEY_LOCAL_MACHINE); + + if ( ! key.OpenKey( "Software\\SWISH-E Team" ) ) return false; + return key.DeleteKey( "SwishCtl" ); +} + +// Create the SwishCtl registry key and add the +// IndexLocation, IndexFiles and DLLVersion keys +bool RegisterIndexFile(char *indexdir, char *indexname) +{ + RegKey key(HKEY_LOCAL_MACHINE); + string keyname(registrykey); + if ( ! key.CreateKey( keyname.c_str() ) ) return false; + + bool kv = key.SetValue( "IndexLocation", indexdir ); + kv &= key.SetValue( "IndexFiles", indexname ); + + kv &= key.SetValue( "DLLVersion", SWISHCTL_VERSION ); + + return kv; +} + +// Remove reference to SwishCtl from the Uninstall section +// of the registry +bool UnregisterUninstall() +{ + RegKey key(HKEY_LOCAL_MACHINE); + + if ( ! key.OpenKey( uninstallkey ) ) return false; + return key.DeleteKey( "SwishCtl" ); +} + +// Register Setup.exe /u in the registry Uninstall section +bool RegisterUninstall(const char *uninstallcommand) +{ + + string keyname(uninstallkey); + keyname += "SwishCtl"; + + RegKey key(HKEY_LOCAL_MACHINE); + if ( ! key.CreateKey( keyname.c_str() ) ) return false; + + bool result = key.SetValue( "DisplayName", "ACC Index Search Tool" ); + result &= key.SetValue( "UninstallString", uninstallcommand ); + + return result; +} + +BOOL LaunchUrl( HWND hwnd, char *url ) +{ + if (ShellExecute( + hwnd, + "open", + url, + NULL, NULL, SW_SHOWNORMAL) < (HINSTANCE)32 ) + { + char *buff[256] ; + sprintf( (char *) buff, + "Setup could not launch the search page (%s) \n" + "please try opening the file from within Internet Explorer.", + url + ); + MessageBox( + NULL, // should pass in the dialog box handle + (char *) buff, + "Swish Control Setup", + MB_OK | MB_ICONASTERISK ); + return FALSE; + } + return TRUE; +} + +// remove the shortcuts in the start menu +bool DeleteShortcuts(char *shortcut, char *subdir) +{ + CStartProgramsDirectory startprograms; + + CDirectory newdir = startprograms + subdir; + + CPath Shortcut = newdir + shortcut; + + bool result = DeleteFile( Shortcut.getBuffer()) != 0; + + RemoveDirectory( newdir.getBuffer()); + return result; + +} + +// add a shortcut to the search page in the startmenu +bool AddShortcut(CDirectory &appdir) +{ + CStartProgramsDirectory startprograms; + + CDirectory newdir = startprograms.CreateChild( "ACC Index" ); + + CPath Shortcut = newdir + "index.lnk"; + CPath IndexPage = appdir + "index.htm"; + + + CreateShortcut( IndexPage.getBuffer(), Shortcut.getBuffer(), + "ACC Index database" ); + startprograms.NotifyChanged(); + return true; +} + + +typedef HRESULT (STDAPICALLTYPE *CTLREGPROC)() ; // Requires stdole.h + +// +bool registerOleDll( const char * pathname ) +{ + LibModule dll; + if ( ! dll.LoadLibrary(pathname) ) return false; + + CTLREGPROC lpDllEntryPoint; + lpDllEntryPoint = (CTLREGPROC) GetProcAddress (dll.getInstance(), + _T("DllRegisterServer")); + + if (!lpDllEntryPoint) return false; //unable to locate entry point + + HRESULT res = (*lpDllEntryPoint)(); + return res == NOERROR; +} + +// +bool unregisterOleDll( const char * pathname ) +{ + LibModule dll; + if ( ! dll.LoadLibrary(pathname) ) return false; + + CTLREGPROC lpDllEntryPoint; + lpDllEntryPoint = (CTLREGPROC)GetProcAddress ( dll.getInstance(), + _T("DllUnregisterServer")); + if (!lpDllEntryPoint) return false; + + HRESULT res = (*lpDllEntryPoint)(); //unable to locate entry point + return res == NOERROR; +} + +// Check whether the Class ID is present +bool AppIsRegistered() +{ + CLSID clsid; + return CLSIDFromProgID(L"SwishCtl.CSwishCtl", &clsid) == S_OK; +} + +BOOL ShowInstallDialog() +{ + return DialogBox (SetupApp::getInstance (), + (LPCTSTR) IDD_SETUP, + NULL, + (DLGPROC) SetupHandler); +} + +void SetAutorun( bool on ) +{ + RegKey key(HKEY_CURRENT_USER); + key.OpenKey( registrykey, KEY_ALL_ACCESS ); + if (on) { + key.SetValue( AUTORUN, "true" ); + } else { + key.SetValue( AUTORUN, "false" ); + } +} + +typedef enum VERSION_AGE { NO_VER, OLDER_VER, CURRENT_VER, NEWER_VER }; + +VERSION_AGE CheckInstalledVersion() +{ + RegKey hkcu(HKEY_LOCAL_MACHINE) ; + if (!hkcu.OpenKey( registrykey, KEY_READ )) { + return NO_VER; + } + string verstring = hkcu.QueryValue( "DLLVersion" ); + + int installed = atoi( verstring.c_str() ); + int current = atoi( SWISHCTL_VERSION ); + if ( !installed ) { + return NO_VER; + } else if (installed < current) { + return OLDER_VER; + } else if (installed == current) { + return CURRENT_VER; + } else { + return NEWER_VER; + } +} + +bool AllowAutorun() +{ + // look up autorun key for this user. + RegKey hkcu(HKEY_CURRENT_USER) ; + if (hkcu.OpenKey( registrykey, KEY_READ )) { + string autorun = hkcu.QueryValue( AUTORUN ); + if ( autorun != "true") { + return false; + } + } + return true; +} + +DWORD FindFile (char *filename, CDirectory &curdir, CDirectory &destdir) +{ + CWinDirectory win; + unsigned int curdirsize = curdir.getSize(); + unsigned int destdirsize = destdir.getSize(); + DWORD result = VerFindFile( VFFF_ISSHAREDFILE, + filename, win.getBuffer(), win.getBuffer(), //appdir=null - directory for related files + curdir.getBuffer(), &curdirsize , + destdir.getBuffer(), &destdirsize); + + return result; +} + +bool ConfirmDiskAccessRetry(const char * windir) +{ + char *buff[256] ; + sprintf( (char *) buff, + "An error occured trying to write to your Windows drive " + "you don't appear to have the correct access priviledges " + "to write to %s, are you sure you want to replace the file?", + windir + ); + + int choice = MessageBox( + NULL, // should pass in the dialog box handle + (char *) buff, "Swish Control Installation", + MB_YESNO | MB_DEFBUTTON2 | MB_ICONINFORMATION ); + return ( choice == IDYES ) ; +} + +bool NoSpaceConfirmRetry() +{ + int choice = MessageBox( + NULL, // should pass in the dialog box handle + "Your Windows drive appears to be out of disk space" + " - try emptying your recycle bin or deleting some files " + "and try again...", + "Swish Control Installation", + MB_RETRYCANCEL | MB_DEFBUTTON2 | MB_ICONINFORMATION ); + return ( choice == IDRETRY ) ; +} + +bool InUseConfirmRetry(const char * filename) +{ + char *buff[256] ; + sprintf( (char *) buff, + "A file (%s) is in use, please close any open applications and retry.", + filename + ); + + int choice = MessageBox( + NULL, // should pass in the dialog box handle + (char *) buff, "Swish Control Installation", + MB_RETRYCANCEL | MB_DEFBUTTON2 | MB_ICONINFORMATION ); + return ( choice == IDRETRY ) ; +} + +bool ConfirmOverwriteOlder(const char * filename) +{ + char *buff[256] ; + sprintf( (char *) buff, + "An newer version of the file (%s) is already installed " + "are you sure you want to overwrite it?", + filename + ); + int choice = MessageBox( + NULL, // should pass in the dialog box handle + (char *) buff, + "Swish Control Installation", + MB_YESNO | MB_ICONASTERISK | MB_DEFBUTTON2 ); + return ( choice == IDYES ); + +} + +void MissingSourceFile( char *filename, char * sourcedir ) +{ + char *buff[256] ; + sprintf( (char *) buff, + "A required file (%s) is missing from the setup directory (%s). " + "Please obtain an original copy of all the setup files " + " and rerun Setup.", + filename, sourcedir + ); + MessageBox( + NULL, // should pass in the dialog box handle + (char *) buff, + "Swish Control Installation", + MB_OK | MB_ICONASTERISK ); + +} + +bool InstallFile (char * filename, + CDirectory &SourceDir, CDirectory &DestDir) +{ + CPath TempFile; + unsigned int buffsize = TempFile.getSize(); + + // ROUND ONE - try a simple install + DWORD flags = VIFF_DONTDELETEOLD; + DWORD result = VerInstallFile( + flags, // bit flags that condition function behavior + filename, // file to install + filename, // new name of file to install + SourceDir.getBuffer(), // source directory of file to install + DestDir.getBuffer(), // directory in which to install file + NULL, // directory where file is currently installed + TempFile.getBuffer(), // receives name of temporary copy of file + // used during installation + &buffsize // size of string in szTmpFile + ); + + while ( result ) { + flags = VIFF_DONTDELETEOLD; + bool retry = false; + + if ( (result & VIF_FILEINUSE) && InUseConfirmRetry(filename) ) + { + retry = true; + } + else if ( result & VIF_CANNOTREADSRC ) // fatal error + { + MissingSourceFile(filename, SourceDir.getBuffer()); + } + else if ( (result & VIF_SRCOLD ) && ConfirmOverwriteOlder(filename) ) + { + flags |= VIFF_FORCEINSTALL; + retry = true; + + } + else if ( result & VIF_TEMPFILE ) { + // todo: work out what to do with the tempfile? + + } else if ( result + & (VIF_SHARINGVIOLATION|VIF_WRITEPROT|VIF_ACCESSVIOLATION) ) + { + if ( ConfirmDiskAccessRetry( DestDir.getBuffer() ) ) { + retry = true; + flags |= VIFF_FORCEINSTALL; + } + + } else if ( (result & VIF_OUTOFSPACE) && NoSpaceConfirmRetry() ) { + retry = true; + } + if ( ! retry ) break; + + result = VerInstallFile( + flags, filename, filename, + SourceDir.getBuffer(), DestDir.getBuffer(), + NULL, TempFile.getBuffer(), &buffsize); + + } + return (result == 0); +} + +void ShowRegistrationFailed(HWND hwnd) +{ + MessageBox( + hwnd, // should pass in the dialog box handle + "An (OLE) error occured registering the search application " + "on your system. Setup cannot continue.", + "Swish Control Installation", + MB_OK | MB_ICONASTERISK ); + +} + +bool Uninstall( HWND hwnd ) +{ + CDirectory curdir, destdir; + FindFile( installdlls[SWISHCTL], curdir, destdir ); + + CPath swishctlpath = curdir + installdlls[SWISHCTL]; + + unregisterOleDll(swishctlpath.getBuffer()); + UnregisterUninstall(); + + BOOL result = DeleteFile( swishctlpath.getBuffer() ); + + // don't worry about deleting these too much + swishctlpath = curdir + installdlls[PCRE]; + DeleteFile( swishctlpath.getBuffer() ); + swishctlpath = curdir + installdlls[PCRE]; + DeleteFile( swishctlpath.getBuffer() ); + + DeleteShortcuts("index.lnk", "ACC Index"); + + if (result) { + + MessageBox( hwnd, + "ACC Index Search Tool has been uninstalled", + "Swish Control Setup", + MB_OK + ); + } else { + MessageBox( hwnd, + "ACC Index Search Tool has been uninstalled" + " but some files could not be deleted perhaps" + " they have been removed already." , + "Swish Control Setup", + MB_OK + ); + } + + return TRUE; +} + + +bool Install( HWND hwnd ) +{ + CDirectory curdir, destdir; + CAppDirectory sourcedir(SetupApp::getInstance()); + + FindFile( installdlls[SWISHCTL], curdir, destdir ); + if (!InstallFile( installdlls[SWISHCTL], sourcedir, destdir )) return false; + + CPath swishctlpath = destdir + installdlls[SWISHCTL]; + + if (!registerOleDll( swishctlpath.getBuffer())) + { + ShowRegistrationFailed(hwnd); + return false; + } + + + if ( ! RegisterIndexFile(sourcedir.getBuffer(), "docs.idx") ) { + MessageBox( hwnd, + "Setup was not able to write configuration details to " + "your system registry. Please try running setup again", + "Swish Control Setup Error", + MB_OK | MB_ICONEXCLAMATION + ); + return false; + } + FindFile( installdlls[PCRE], curdir, destdir ); + if (!InstallFile( installdlls[PCRE], sourcedir, destdir )) return false; + + FindFile( installdlls[ZLIB], curdir, destdir ); + if(!InstallFile( installdlls[ZLIB], sourcedir, destdir )) return false; + + AddShortcut(sourcedir); + + CPath uninstaller = sourcedir + "setup.exe /u"; + RegisterUninstall(uninstaller.getBuffer()); + + MessageBox( hwnd, + "Setup Complete", + "Swish Control Setup", + MB_OK | MB_ICONINFORMATION + ); + return true; +} + + +#if 0 +void DoTests() +{ + char curdir[_MAX_PATH]; + char destdir[_MAX_PATH]; + UINT curdirlen = _MAX_PATH; + UINT destdirlen = _MAX_PATH; + + AppDir appdir; + char *ad = appdir.c_str(); + + FilePath fp("C:\\CRAP", _MAX_PATH); + fp = fp + (const char *)"crap.exe"; + + FilePath fp2; + + fp2 = fp2 + (const char *)"whatever"; + + fp2 = fp + fp2; + + + FilePath fp3(NULL, _MAX_PATH); + DWORD copied = GetModuleFileName( SetupApp::getInstance(), + fp3.c_str(), fp3.getSize()); + + string fname(_MAX_PATH, '\0'); + + copied = GetModuleFileName( SetupApp::getInstance(), + (char *)fname.c_str(), fname.length()); +} +#endif + +bool ConfirmUpgrade() +{ + int choice = MessageBox( + GetDesktopWindow(), // could try GetDesktopWindow() + "An older version of the search tool is installed." + " Would you like to upgrade?", + "Swish Control Installation", + MB_YESNO | MB_ICONQUESTION ); + return ( choice == IDYES ); +} + +BOOL LaunchSearchPage( ) +{ + CAppDirectory appdir( SetupApp::getInstance()); + CPath indexfile = appdir + "index.htm"; + return LaunchUrl( NULL, indexfile.getBuffer() ); + +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - +// WinMain +// Check the command line and registry options +// to decide what to do or whether to do nothing at all! +// - - - - - - - - - - - - - - - - - - - - - - - - - - - +int APIENTRY WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + + + // Perform application initialization: + SetupApp _app( hInstance ); + + // TestPathsModule(SetupApp::getInstance()); + // DoTests(); return 0; + + // Check for [/u] (uninstall) on command line + if ( strstr( lpCmdLine, "/U" ) || strstr( lpCmdLine, "/u" )) { + return Uninstall(NULL); + } + + // Check for [/f] (force display of dialog) on command line + if ( strstr( lpCmdLine, "/F" ) + || strstr( lpCmdLine, "/f" ) + || !AppIsRegistered() ) + { + if( ShowInstallDialog() ) { + LaunchSearchPage (); + } + return 0; + } + + switch ( CheckInstalledVersion() ) { + case NO_VER: + if( ShowInstallDialog() ) { + LaunchSearchPage (); + } + break; + case OLDER_VER: + if ( !ConfirmUpgrade() ) break; + + if( ShowInstallDialog() ) { + LaunchSearchPage (); + } + break; + case CURRENT_VER: + if ( AllowAutorun() ) + { + LaunchSearchPage (); + } + break; + case NEWER_VER: + if ( AllowAutorun() ) + { + LaunchSearchPage (); + } + break; + } + return 0; +} + + +// Mesage handler for about box. +// does the actual install ! +LRESULT CALLBACK SetupHandler(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + return TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK ) + { + bool autorun = + (IsDlgButtonChecked (hDlg, IDC_AUTORUN) != BST_CHECKED); + + SetAutorun( autorun ); + + Install( hDlg ); + + EndDialog(hDlg, (BOOL) autorun ); + return TRUE; + } + else if ( LOWORD(wParam) == IDC_EXIT) + { + EndDialog(hDlg, FALSE); + return TRUE; + } + break; + } + return FALSE; +} + + Index: /swishctl/src/setup/setup.dsp =================================================================== --- /swishctl/src/setup/setup.dsp (revision 1232) +++ /swishctl/src/setup/setup.dsp (revision 1232) @@ -0,0 +1,164 @@ +# Microsoft Developer Studio Project File - Name="setup" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=setup - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "setup.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "setup.mak" CFG="setup - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "setup - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "setup - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "setup - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x1409 /d "NDEBUG" +# ADD RSC /l 0x1409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib version.lib /nologo /subsystem:windows /machine:I386 /out:"../Release/setup.exe" + +!ELSEIF "$(CFG)" == "setup - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x1409 /d "_DEBUG" +# ADD RSC /l 0x1409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib version.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../debug/setup.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "setup - Win32 Release" +# Name "setup - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\paths.cpp +# End Source File +# Begin Source File + +SOURCE=..\regkey.cpp +# End Source File +# Begin Source File + +SOURCE=.\setup.cpp +# End Source File +# Begin Source File + +SOURCE=.\setup.rc +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\stringbuffer.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\paths.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\setup.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# Begin Source File + +SOURCE=.\stringbuffer.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\setup.ico +# End Source File +# Begin Source File + +SOURCE=.\small.ico +# End Source File +# Begin Source File + +SOURCE=.\swishctl.ICO +# End Source File +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project Index: /swishctl/src/setup/stringbuffer.h =================================================================== --- /swishctl/src/setup/stringbuffer.h (revision 1232) +++ /swishctl/src/setup/stringbuffer.h (revision 1232) @@ -0,0 +1,22 @@ +// stringbuffer.h: interface for the stringbuffer class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_STRINGBUFFER_H__C9ABFB60_4DFC_4C9D_AE7C_1224825A1DDB__INCLUDED_) +#define AFX_STRINGBUFFER_H__C9ABFB60_4DFC_4C9D_AE7C_1224825A1DDB__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class stringbuffer +{ +public: + stringbuffer(); + virtual ~stringbuffer(); + +protected: + char * m_buffer; +}; + +#endif // !defined(AFX_STRINGBUFFER_H__C9ABFB60_4DFC_4C9D_AE7C_1224825A1DDB__INCLUDED_) Index: /swishctl/src/setup/setup.h =================================================================== --- /swishctl/src/setup/setup.h (revision 1232) +++ /swishctl/src/setup/setup.h (revision 1232) @@ -0,0 +1,12 @@ + +#if !defined(AFX_SETUP_H__62020289_6B7A_11D7_858F_8AE7159BAA0C__INCLUDED_) +#define AFX_SETUP_H__62020289_6B7A_11D7_858F_8AE7159BAA0C__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "resource.h" + + +#endif // !defined(AFX_SETUP_H__62020289_6B7A_11D7_858F_8AE7159BAA0C__INCLUDED_) Index: /swishctl/src/setup/paths.cpp =================================================================== --- /swishctl/src/setup/paths.cpp (revision 1232) +++ /swishctl/src/setup/paths.cpp (revision 1232) @@ -0,0 +1,293 @@ +// paths.cpp: implementation of the CDirectory class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "paths.h" +#include + +using namespace std; + +void CBuffer::init(char *initialvalue, unsigned int initialsize) +{ + delete[] buffer; // + buffersize = initialsize; + if ( !buffersize ) { + buffer = NULL; + return; + } + + if ( !initialvalue ) { + buffer = new char[buffersize]; + buffer[0] = '\0'; + } else { + unsigned int namelength = strlen( initialvalue ); + // use a larger buffer if necessary + if ( namelength > buffersize ) { + buffersize = namelength + 1; + } + buffer = new char[buffersize]; + strcpy( buffer, initialvalue ); + } +} + +CBuffer::CBuffer(unsigned int maxsize) +{ + buffer = NULL; + buffmax = maxsize; + init( NULL, buffmax ); +} + +CBuffer::CBuffer(unsigned int maxsize, CBuffer &source) +{ + buffmax = maxsize; + buffer = NULL; + init( source.getBuffer(), source.getSize()); +} + +CBuffer::CBuffer (unsigned int maxsize, char *initialvalue) +{ + buffmax = maxsize; + buffer = NULL; + init( initialvalue, buffmax); +} + +void CBuffer::operator =(CBuffer &source) +{ + init( source.getBuffer(), source.getSize()); +} + +void CBuffer::operator =(char *initialvalue) +{ + init( initialvalue, buffmax); +} + +CBuffer::~CBuffer() +{ + delete[] buffer; +} + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CDirectory& CDirectory::operator =(CDirectory &source) +{ + // should I delete "this" first? + if (this == &source) return *this; + return *(new CDirectory(source)); +} + +CDirectory& CDirectory::operator =(char *dirname) +{ + // should I delete "this" first? + return *(new CDirectory(dirname)); +} + +CPath& CDirectory::Append(char *extra) +{ + if ( buffer ) { + CPath *temp = new CPath(buffer); + + int thislen = strlen (buffer); + char finalchar = buffer[thislen-1]; + + if ( finalchar != '\\' && finalchar != '/' ) { + strcat( temp->getBuffer(), "\\"); + } + + strcat( temp->getBuffer(), extra); + return *temp; + } else { // this.m_str is null + // return a copy of the filename... + return *(new CPath(extra)); + } + +} + +CPath& CDirectory::operator +(char *extra) +{ + return Append(extra); +} + + +CPath& CDirectory::operator +(CFilename &filename) +{ + return Append( filename.getBuffer()); +} + +void CPath::operator =(CPath &source) +{ + init( source.getBuffer(), source.getSize()); +} + +void CPath::operator =(char *pathname) +{ + init( pathname, _MAX_PATH); +} + + + +CFilename& CPath::getFilename() +{ + static char fname[_MAX_FNAME]; + static char extname[_MAX_EXT]; + CFilename *temp = new CFilename(); + + // split the FileNameAndExtension parameter + _splitpath (buffer, NULL, NULL, fname, extname); + // assemble full path + _makepath (temp->getBuffer(), NULL, NULL, fname, extname); + + return *temp; +} + + +CDirectory& CPath::getDirectory() +{ + static char drvname[_MAX_FNAME]; + static char dirname[_MAX_EXT]; + CDirectory *temp = new CDirectory(); + + // split the FileNameAndExtension parameter + _splitpath (buffer, drvname, dirname, NULL, NULL); + // assemble full path + _makepath (temp->getBuffer(), drvname, dirname, NULL, NULL); + + return *temp; +} + + + +////////////////////////////////////////////////////////////////////// +// CFilename Class +////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +void CFilename::operator =(CFilename &source) +{ + init( source.getBuffer(), source.getSize()); +} + +void CFilename::operator =(char *filename) +{ + init( filename, buffmax); +} + +////////////////////////////////////////////////////////////////////// +// CAppDirectory Class +////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CAppDirectory::CAppDirectory(HINSTANCE apphandle) +{ + CPath temppath; + + DWORD copied = GetModuleFileName( apphandle, + temppath.getBuffer(), temppath.getSize()); + CDirectory tempdir = temppath.getDirectory(); + strcpy(getBuffer(), tempdir.getBuffer()); + +} + +CWinDirectory::CWinDirectory() +{ + UINT buffsize = GetWindowsDirectory (getBuffer(), 0); + if ( buffsize > getSize() ) { + init( NULL, buffsize ); + } + GetWindowsDirectory (getBuffer(), buffsize); // result should be < buffsize +} + +CStartProgramsDirectory::CStartProgramsDirectory() +{ + LPITEMIDLIST pidlPrograms; + + //get the pidl for Start|Programs + SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlPrograms); + + BOOL result = SHGetPathFromIDList( pidlPrograms, getBuffer() ); + +} + +void CStartProgramsDirectory::NotifyChanged() +{ + SHChangeNotify(SHCNE_MKDIR, SHCNF_PATH, getBuffer(), 0); +} + +CDirectory & CStartProgramsDirectory::operator+(char *childname) +{ + CDirectory *fullpath = new CDirectory(*this); + + unsigned int pathlength = strlen(fullpath->getBuffer()); + + char finalchar = (fullpath->getBuffer())[pathlength-1]; + + if ( finalchar != '\\' && finalchar != '/' ) { + strcat( fullpath->getBuffer(), "\\"); + } + strcat( fullpath->getBuffer(), childname); + + return *fullpath; +} + +CDirectory &CStartProgramsDirectory::CreateChild(char *childname) +{ + CDirectory *fullpath = new CDirectory(*this); + + unsigned int pathlength = strlen(fullpath->getBuffer()); + + char finalchar = (fullpath->getBuffer())[pathlength-1]; + + if ( finalchar != '\\' && finalchar != '/' ) { + strcat( fullpath->getBuffer(), "\\"); + } + strcat( fullpath->getBuffer(), childname); + + if (! CreateDirectory(fullpath->getBuffer(), NULL) ) { + // what todo: ??? + } + + return *fullpath; +} + +bool CStartProgramsDirectory::DeleteChild(char *childname) +{ + CDirectory fullpath = *this + childname; + return RemoveDirectory(fullpath.getBuffer()) != 0; +} + + +void TestPathsModule(HINSTANCE apphandle) +{ + CDirectory dir1( "C:\\Program Files\\" ); + CDirectory dircopy( dir1 ); + CFilename fn("yaah.txt" ); + CPath &pathname = dir1 + fn; + CAppDirectory app(apphandle); + + CWinDirectory dir2; + CPath path3 = dir2 + fn; + CFilename fn2 = pathname.getFilename(); + + try { + char *dir1buff = dir1.getBuffer(); + unsigned int dir1size = dir1.getSize(); + + + unsigned int dir2size = dircopy.getSize(); // should throw an exception + char *dir2buff = dircopy.getBuffer(); + + } catch (...) { + int i = 1; + } +} + + Index: /swishctl/src/setup/setup.rc =================================================================== --- /swishctl/src/setup/setup.rc (revision 1232) +++ /swishctl/src/setup/setup.rc (revision 1232) @@ -0,0 +1,181 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +#include "resource.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_SETUP ICON DISCARDABLE "swishctl.ICO" +IDI_SMALL ICON DISCARDABLE "SMALL.ICO" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SETUP DIALOG DISCARDABLE 22, 17, 230, 75 +STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Setup" +FONT 9, "Arial" +BEGIN + PUSHBUTTON "&Install",IDOK,69,57,31,13,WS_GROUP + PUSHBUTTON "E&xit",IDC_EXIT,127,57,29,12 + CONTROL "Supress CD auto-run",IDC_AUTORUN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,26,20,98,9 + ICON IDI_SETUP,IDC_MYICON,3,4,20,20,WS_BORDER + LTEXT "SwishCtl Search Tool -Setup (v. 1.1)",IDC_STATIC,26,7, + 184,8,SS_NOPREFIX + LTEXT "Copyright (C) 2003 Wellington People's Centre Inc.", + IDC_STATIC,26,37,202,8 +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""resource.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APP_TITLE "setup" + IDS_HELLO "Hello World!" + IDC_SETUP "SETUP" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (New Zealand) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENZ) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_NZ +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,8 + PRODUCTVERSION 1,0,0,8 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Released under the GNU Public Licence\0" + VALUE "CompanyName", "Te Kauranga\0" + VALUE "FileDescription", "SwishCtl Setup and Autorun Application\0" + VALUE "FileVersion", "1, 0, 0, 8\0" + VALUE "InternalName", "SwishCtl\0" + VALUE "LegalCopyright", "Copyright © 2003 The Peoples Resource Centre Wellington NZ\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "SwishCtl.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Te Kauranga SwishCtl\0" + VALUE "ProductVersion", "1, 0, 0, 8\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + +#endif // English (New Zealand) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Index: /swishctl/src/setup/paths.h =================================================================== --- /swishctl/src/setup/paths.h (revision 1232) +++ /swishctl/src/setup/paths.h (revision 1232) @@ -0,0 +1,111 @@ +// paths.h: interface for the CDirectory class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_PATHS_H__AE9DC3AE_4C19_4DEB_9074_053EF38B7400__INCLUDED_) +#define AFX_PATHS_H__AE9DC3AE_4C19_4DEB_9074_053EF38B7400__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + + +class CBuffer +{ +public: + virtual ~CBuffer (); + CBuffer (unsigned int maxsize); + CBuffer (unsigned int maxsize, CBuffer &source); + CBuffer (unsigned int maxsize, char *initialvalue); + void operator= (CBuffer &source); + void operator= (char *initialvalue); + + virtual unsigned int getSize() {return buffersize;}; + virtual char * getBuffer(){return buffer;}; +protected: + virtual void init( char *initialvalue, unsigned int initialsize ); + char * buffer; + unsigned int buffersize; + unsigned int buffmax; +}; + +class CPath ; +class CFilename ; +class CDirectory; + +class CPath : public CBuffer +{ +public: + CDirectory& getDirectory(); + CFilename& getFilename(); + CPath () : CBuffer( _MAX_PATH ) {}; + CPath (CPath &source) : CBuffer( _MAX_PATH, source ) {}; + CPath (char *pathname) : CBuffer( _MAX_PATH, pathname ) {}; + void operator= (CPath &source); + void operator= (char *pathname); + + virtual unsigned int getSize() {return buffersize;}; + virtual char * getBuffer(){return buffer;}; +}; + +class CFilename : public CBuffer +{ +public: + CFilename () : CBuffer( _MAX_FNAME ) {}; + CFilename (CFilename &source) : CBuffer( _MAX_FNAME, source ) {}; + CFilename (char *filename) : CBuffer( _MAX_FNAME, filename ) {}; + void operator= (CFilename &source); + void operator= (char *filename); + + virtual unsigned int getSize() {return buffersize;}; + virtual char * getBuffer(){return buffer;}; +}; + +class CDirectory : public CBuffer +{ +public: + CPath& Append( char * extra); + CPath& operator+ (CFilename& filename); + CPath& operator+ (char *extra); + CDirectory () : CBuffer( _MAX_DIR ) {}; + CDirectory (CDirectory &source) : CBuffer( _MAX_DIR, source ) {}; + CDirectory (char *dirname) : CBuffer( _MAX_DIR, dirname ) {}; + CDirectory& operator= (CDirectory &source); + CDirectory& operator= (char *dirname); + + virtual unsigned int getSize() {return buffersize;}; + virtual char * getBuffer(){return buffer;}; +}; + + +void TestPathsModule(HINSTANCE apphandle); + + +class CAppDirectory : public CDirectory +{ +public: + CAppDirectory( HINSTANCE apphandle); +protected: + CAppDirectory() {}; // prevent use of no parameter constructor +private: +}; + +class CWinDirectory : public CDirectory +{ +public: + CWinDirectory(); +}; + +class CStartProgramsDirectory : public CDirectory +{ +public: + CDirectory & operator+( char * childname ); + bool DeleteChild( char * childname); + CDirectory &CreateChild( char * childname ); + void NotifyChanged(); + CStartProgramsDirectory(); +}; + + +#endif // !defined(AFX_PATHS_H__AE9DC3AE_4C19_4DEB_9074_053EF38B7400__INCLUDED_) Index: /swishctl/src/setup/StdAfx.cpp =================================================================== --- /swishctl/src/setup/StdAfx.cpp (revision 1232) +++ /swishctl/src/setup/StdAfx.cpp (revision 1232) @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// setup.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file Index: /swishctl/src/setup/ReadMe.txt =================================================================== --- /swishctl/src/setup/ReadMe.txt (revision 1232) +++ /swishctl/src/setup/ReadMe.txt (revision 1232) @@ -0,0 +1,56 @@ +======================================================================== + WIN32 APPLICATION : setup +======================================================================== + + +AppWizard has created this setup application for you. + +This file contains a summary of what you will find in each of the files that +make up your setup application. + +setup.cpp + This is the main application source file. + +setup.dsp + This file (the project file) contains information at the project level and + is used to build a single project or subproject. Other users can share the + project (.dsp) file, but they should export the makefiles locally. + + +///////////////////////////////////////////////////////////////////////////// +AppWizard has created the following resources: + +setup.rc + This is a listing of all of the Microsoft Windows resources that the + program uses. It includes the icons, bitmaps, and cursors that are stored + in the RES subdirectory. This file can be directly edited in Microsoft + Visual C++. + +res\setup.ico + This is an icon file, which is used as the application's icon (32x32). + This icon is included by the main resource file setup.rc. + +small.ico + %%This is an icon file, which contains a smaller version (16x16) + of the application's icon. This icon is included by the main resource + file setup.rc. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named setup.pch and a precompiled types file named StdAfx.obj. + +Resource.h + This is the standard header file, which defines new resource IDs. + Microsoft Visual C++ reads and updates this file. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" to indicate parts of the source code you +should add to or customize. + + +///////////////////////////////////////////////////////////////////////////// Index: /swishctl/src/setup/resource.h =================================================================== --- /swishctl/src/setup/resource.h (revision 1232) +++ /swishctl/src/setup/resource.h (revision 1232) @@ -0,0 +1,30 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by setup.rc +// +#define IDC_MYICON 2 +#define IDD_SETUP_DIALOG 102 +#define IDD_ABOUTBOX 103 +#define IDS_APP_TITLE 103 +#define IDD_SETUP 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDS_HELLO 106 +#define IDI_SETUP 107 +#define IDI_SMALL 108 +#define IDC_SETUP 109 +#define IDR_MAINFRAME 128 +#define IDC_EXIT 1000 +#define IDC_AUTORUN 1001 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1002 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif Index: /swishctl/src/SwishCtl.rc =================================================================== --- /swishctl/src/SwishCtl.rc (revision 1232) +++ /swishctl/src/SwishCtl.rc (revision 1232) @@ -0,0 +1,140 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "1 TYPELIB ""SwishCtl.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,8 + PRODUCTVERSION 1,0,0,8 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Released under GNU Public Licence\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "SwishCtl Module\0" + VALUE "FileVersion", "1, 0, 0, 8\0" + VALUE "InternalName", "SwishCtl\0" + VALUE "LegalCopyright", "Copyright (c) 2003 Peoples Resource Centre Wellington NZ\0" + VALUE "LegalTrademarks", "\0" + VALUE "OLESelfRegister", "\0" + VALUE "OriginalFilename", "SwishCtl.DLL\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "SwishCtl Module\0" + VALUE "ProductVersion", "1, 0, 0, 8\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROJNAME "SwishCtl" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (New Zealand) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENZ) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_NZ +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_CSWISHCTL REGISTRY DISCARDABLE "CSwishCtl.rgs" +#endif // English (New Zealand) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +1 TYPELIB "SwishCtl.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Index: /swishctl/src/paths.h =================================================================== --- /swishctl/src/paths.h (revision 1232) +++ /swishctl/src/paths.h (revision 1232) @@ -0,0 +1,2 @@ +// paths.h + Index: /swishctl/src/AnsiBSTR.cpp =================================================================== --- /swishctl/src/AnsiBSTR.cpp (revision 1236) +++ /swishctl/src/AnsiBSTR.cpp (revision 1236) @@ -0,0 +1,101 @@ +/* + * $Id$ + * + * SwishCtl - SWISH-E API ActiveX Control + * Copyright (c) 2003 Peoples Resource Centre Wellington NZ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// AnsiBSTR.cpp: implementation of the CAnsiBSTR class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "AnsiBSTR.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CAnsiBSTR::CAnsiBSTR(const char *source) +{ + int sourcelen = strlen( source ); + //m_cstr = NULL; + wchar_t *wbuffer = (wchar_t *)calloc( sourcelen + 1, sizeof(wchar_t)); + + if ( ! wbuffer ) return; + + MultiByteToWideChar( CP_ACP, // code page + NULL, // character-type options + source, // string to map + sourcelen, // number of bytes in string + wbuffer, // wide-character buffer + sourcelen + 1 // size of buffer + ); + this->Attach(SysAllocString( wbuffer )); + free( wbuffer ); +} + +CAnsiBSTR::~CAnsiBSTR() +{ + //if ( m_cstr ) free( m_cstr ); +} + + + +CAnsiBSTR::CAnsiBSTR(BSTR bstr) +{ + //m_cstr = NULL; + this->Attach( bstr ); +} + +// ----------------------------- + + +CAnsiStr::~CAnsiStr() +{ + if ( m_cstr ) free( m_cstr ); +} + +char * CAnsiStr::c_str() +{ + return m_cstr; +} + +CAnsiStr::CAnsiStr(BSTR bstr) +{ + m_cstr = NULL; + + int sourcelen = SysStringLen(bstr); + + m_cstr = (char *) calloc( sourcelen + 1, sizeof(char)); + + if ( ! m_cstr ) return; + + WideCharToMultiByte( + CP_ACP, // code page + NULL, // performance and mapping flags + bstr, // wide-character string + sourcelen, // number of chars in string + m_cstr , // buffer for new string + sourcelen + 1, // size of buffer + NULL, // default for unmappable chars NULL + NULL // set when default char used + ); + + m_cstr [sourcelen] = '\0'; +} + Index: /swishctl/src/SwishCtl.idl =================================================================== --- /swishctl/src/SwishCtl.idl (revision 1232) +++ /swishctl/src/SwishCtl.idl (revision 1232) @@ -0,0 +1,51 @@ +// SwishCtl.idl : IDL source for SwishCtl.dll +// + +// This file will be processed by the MIDL tool to +// produce the type library (SwishCtl.tlb) and marshalling code. + +import "oaidl.idl"; +import "ocidl.idl"; + [ + object, + uuid(9E204F2D-4F04-11D7-858F-8CA08FF5860C), + dual, + helpstring("ICSwishCtl Interface"), + pointer_default(unique) + ] + interface ICSwishCtl : IDispatch + { + [id(1), helpstring("method Init")] HRESULT Init([in] BSTR IndexFiles); + [id(2), helpstring("method Error")] HRESULT Error([out,retval] int *errcode); + [id(3), helpstring("method Query")] HRESULT Query([in] BSTR words, [out,retval] int *errcode); + [id(4), helpstring("method ErrorString")] HRESULT ErrorString([out,retval] BSTR *errstring); + [id(5), helpstring("method Hits")] HRESULT Hits([out,retval] int *hits); + [id(6), helpstring("method NextResult")] HRESULT NextResult([out,retval] int *more); + [id(7), helpstring("method ResultPropertyString")] HRESULT ResultPropertyString([in] BSTR propertyname, [out,retval] BSTR *result); + [id(8), helpstring("method Close")] HRESULT Close(); + [id(9), helpstring("method SeekResult")] HRESULT SeekResult([in] int position, [out,retval] int *result); + [id(10), helpstring("method SetSort")] HRESULT SetSort([in] BSTR sort); + [id(11), helpstring("method NewSearch")] HRESULT NewSearch([in] BSTR query, [out,retval] int *errcode); + [id(12), helpstring("method Execute")] HRESULT Execute([in] BSTR words, [out,retval] int *errcode); + [id(13), helpstring("method SetSearchLimit")] HRESULT SetSearchLimit([in] BSTR propertyname, [in] BSTR low, [in] BSTR hi); + }; + +[ + uuid(9E204F21-4F04-11D7-858F-8CA08FF5860C), + version(1.0), + helpstring("SwishCtl 1.0 Type Library") +] +library SWISHCTLLib +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + [ + uuid(9E204F2E-4F04-11D7-858F-8CA08FF5860C), + helpstring("CSwishCtl Class") + ] + coclass CSwishCtl + { + [default] interface ICSwishCtl; + }; +}; Index: /swishctl/src/regkey.cpp =================================================================== --- /swishctl/src/regkey.cpp (revision 1236) +++ /swishctl/src/regkey.cpp (revision 1236) @@ -0,0 +1,141 @@ +/* + * $Id$ + * + * SwishCtl - SWISH-E API ActiveX Control + * Copyright (c) 2003 Peoples Resource Centre Wellington NZ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * RegKey Starts + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +#include "stdafx.h" +#include +using namespace std; + +#include "regkey.h" + +RegKey::RegKey(HKEY startkey) +{ + hkey=NULL; + this->startkey = startkey; +} + +bool RegKey::CreateKey(const char *keyname) +{ + if ( ! keyname ) return false; + if (hkey) RegCloseKey(hkey); + + LONG res = RegCreateKeyEx(startkey, keyname, + 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, 0, &hkey, 0 ) ; + + return res == ERROR_SUCCESS; +} + +bool RegKey::OpenKey(const char *keyname, REGSAM samdesired ) +{ + if ( ! keyname ) return false; + if (hkey) RegCloseKey(hkey); +#if 0 + LONG res = RegOpenKeyEx (startkey, + (const char *)keyname, + 0, + samdesired, + &hkey); +#endif + DWORD disposition; + LONG res = RegCreateKeyEx( + startkey, // handle to an open key + (const char *)keyname, // address of subkey name + 0, // reserved + NULL, // address of class string + REG_OPTION_NON_VOLATILE, // special options flag + samdesired, // desired security access + NULL, + // address of key security structure + &hkey, // address of buffer for opened handle + &disposition // address of disposition value buffer + ); + + return res == ERROR_SUCCESS; +} + +bool RegKey::OpenKey(const char *keyname) +{ + return OpenKey(keyname, KEY_ALL_ACCESS ); +} + +bool RegKey::SetValue(const char *valuename, const char *value) +{ + if ( ! valuename || ! value ) return false; + LONG res = RegSetValueEx( hkey, valuename, 0, REG_SZ, + (const unsigned char *)value, lstrlen(value)+1); + return res == ERROR_SUCCESS; +} + + +string RegKey::QueryValue(const char *valuename) +{ + DWORD dwType = REG_SZ; + + if (! hkey ) return NULL; // can I do this ? + + LPBYTE lpData = NULL; + DWORD cbData = 0; + + LONG res = RegQueryValueEx( hkey, valuename, 0, &dwType, NULL, &cbData ); + +// if ( res != ERROR_MORE_DATA ) { // this should be true but isn't +// ::MessageBox( NULL, "ERROR_MORE_DATA should have been seen...", +// "Whatever", MB_OK ); +// return NULL; +// } + + lpData = (LPBYTE) malloc( cbData ); + + if ( !lpData ) { + ::MessageBox( NULL, "Out of memory error occured in QueryValue function.", + "SwishCtl Error", MB_OK | MB_ICONINFORMATION); + + return *(new string()); + } + + res = RegQueryValueEx( hkey, valuename, 0, &dwType, lpData, &cbData ); + + if (res != ERROR_SUCCESS) { + free( lpData ); + return *(new string()); + } + + string *temp = new string( (char *)lpData ) ; + free( lpData ); + + return *temp; +} + +RegKey::~RegKey() +{ + if ( hkey ) ::RegCloseKey(hkey); +} + +bool RegKey::DeleteKey(const char *subkey) +{ + return ::RegDeleteKey(hkey, subkey ) == ERROR_SUCCESS; +} + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * RegKey ends + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ Index: /swishctl/src/SwishCtlps.mk =================================================================== --- /swishctl/src/SwishCtlps.mk (revision 1232) +++ /swishctl/src/SwishCtlps.mk (revision 1232) @@ -0,0 +1,16 @@ + +SwishCtlps.dll: dlldata.obj SwishCtl_p.obj SwishCtl_i.obj + link /dll /out:SwishCtlps.dll /def:SwishCtlps.def /entry:DllMain dlldata.obj SwishCtl_p.obj SwishCtl_i.obj \ + kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \ + +.c.obj: + cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \ + $< + +clean: + @del SwishCtlps.dll + @del SwishCtlps.lib + @del SwishCtlps.exp + @del dlldata.obj + @del SwishCtl_p.obj + @del SwishCtl_i.obj Index: /swishctl/src/StdAfx.cpp =================================================================== --- /swishctl/src/StdAfx.cpp (revision 1232) +++ /swishctl/src/StdAfx.cpp (revision 1232) @@ -0,0 +1,12 @@ +// stdafx.cpp : source file that includes just the standard includes +// stdafx.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +#ifdef _ATL_STATIC_REGISTRY +#include +#include +#endif + +#include Index: /swishctl/src/AnsiBSTR.h =================================================================== --- /swishctl/src/AnsiBSTR.h (revision 1232) +++ /swishctl/src/AnsiBSTR.h (revision 1232) @@ -0,0 +1,30 @@ +// AnsiBSTR.h: interface for the CAnsiBSTR class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_ANSIBSTR_H__5C10CD8E_238E_4483_A5C3_702741F49B3E__INCLUDED_) +#define AFX_ANSIBSTR_H__5C10CD8E_238E_4483_A5C3_702741F49B3E__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CAnsiBSTR : public CComBSTR +{ +public: + CAnsiBSTR( BSTR bstr); + CAnsiBSTR(const char *source); + virtual ~CAnsiBSTR(); + +}; + +class CAnsiStr +{ +public: + CAnsiStr( BSTR bstr); + char * c_str(); + virtual ~CAnsiStr(); +private: + char * m_cstr; +}; +#endif // !defined(AFX_ANSIBSTR_H__5C10CD8E_238E_4483_A5C3_702741F49B3E__INCLUDED_) Index: /swishctl/src/regkey.h =================================================================== --- /swishctl/src/regkey.h (revision 1232) +++ /swishctl/src/regkey.h (revision 1232) @@ -0,0 +1,22 @@ +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * RegKey Starts + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +class RegKey { +public: + RegKey() {hkey=NULL; startkey=HKEY_CURRENT_USER;}; + RegKey(HKEY startkey); + ~RegKey(); + bool CreateKey(const char *keyname); + bool OpenKey( const char * keyname); + bool OpenKey( const char * keyname, REGSAM samdesired); + bool SetValue(const char *valuename, const char *value); + bool DeleteKey(const char *subkey); + string QueryValue(const char *valuename); +private: + HKEY startkey; + HKEY hkey; +}; + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * RegKey ends + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ Index: /swishctl/src/FilePath.cpp =================================================================== --- /swishctl/src/FilePath.cpp (revision 1236) +++ /swishctl/src/FilePath.cpp (revision 1236) @@ -0,0 +1,161 @@ +/* + * $Id$ + * + * SwishCtl - SWISH-E API ActiveX Control + * Copyright (c) 2003 Peoples Resource Centre Wellington NZ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - + * class FilePath + * - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +class FilePath { +public: + FilePath& append(const char *extra); + + unsigned int getSize() {return m_size;}; + char * c_str() {return m_str;}; + + bool Reallocate( unsigned int NewSize ); + FilePath * copy(); + FilePath &operator+( FilePath &extrapath ); + FilePath &operator+( const char *extrapath ); + + + FilePath(const char *path); + FilePath(const char *path, unsigned int storage); + FilePath(); + + ~FilePath(); + +private: + char * m_str; + unsigned int m_size; + void Initialise(const char *path, unsigned int storage); +}; + +void FilePath::Initialise(const char *path, unsigned int storage) +{ + m_str = NULL; + m_size = 0; + + if (storage) { + bool result = Reallocate (storage); + + if (result && path) { + strcpy (m_str, path); + } + } +} + +FilePath::FilePath() +{ + Initialise (NULL, 0); +} + + +FilePath::FilePath(const char *path, unsigned int storage) +{ + Initialise( path, storage ); +} + +FilePath::FilePath(const char *path) +{ + if ( ! path ) { + Initialise( NULL, 0 ); + } else { + Initialise( path, strlen(path) + 1 ); + } +} + + +FilePath& FilePath::append(const char *extra) +{ + if ( m_str ) { + + FilePath *temp = new FilePath(); + + if ( !extra || !temp || (*extra == '\0')) return *temp; + + int thislen = strlen( m_str ); + int extralen = strlen( extra ); + int totallen = thislen + extralen; + bool appendbackslash = false; + + if ( m_str[thislen-1] != '\\' && m_str[thislen-1] != '/' ) { + appendbackslash = true; + if (!temp->Reallocate( thislen + extralen + 2 ) ) { + return *temp; + } + strcpy( temp->c_str(), this->m_str ); + strcat( temp->c_str(), "\\" ); + strcat (temp->c_str(), extra); + + } else { + temp->Reallocate( thislen + extralen + 1 ); + strcpy( temp->c_str(), this->m_str ); + strcat (temp->c_str(), extra); + } + return *temp; + } else { // this.m_str is null + // return a copy of the extra path... + return *(new FilePath(extra)); + } +} + + +FilePath &FilePath::operator+( const char * extra ) +{ + return append(extra); +} + + + +FilePath &FilePath::operator+( FilePath &extrapath ) +{ + char *extra = extrapath.c_str(); + return *this + extra; +} + + +FilePath::~FilePath() +{ + delete[] m_str; +} + +bool FilePath::Reallocate(unsigned int NewSize) +{ + // + m_size = 0; + delete[] m_str; + m_str = new char[NewSize]; + + if (! m_str ) return false; + m_str[0] = '\0'; + m_size = NewSize; + return true; +} + + +FilePath * FilePath::copy() +{ + FilePath *temp = new FilePath(); + if ( temp->Reallocate( this->getSize() ) ) { + strcpy( temp->c_str(), this->c_str() ); + } + return temp; +} + Index: /swishctl/src/resource.h =================================================================== --- /swishctl/src/resource.h (revision 1232) +++ /swishctl/src/resource.h (revision 1232) @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by SwishCtl.rc +// +#define IDS_PROJNAME 100 +#define IDR_CSWISHCTL 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 201 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif Index: /swishctl/COPYING =================================================================== --- /swishctl/COPYING (revision 1236) +++ /swishctl/COPYING (revision 1236) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Index: /swishctl/example/help.htm =================================================================== --- /swishctl/example/help.htm (revision 1302) +++ /swishctl/example/help.htm (revision 1302) @@ -0,0 +1,44 @@ + + +SwishCtl Help + + + + +

How to search with SwishCtl

+

It's easy! Just type the word or words you are looking for +into the query: box and press enter.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
In order to: 
Restrict your search to particular years:enter the years into the from: and to: boxes
Search for a phrase:put your phrase in double quotes eg: "some words"
Return to your list of query results:click the back button on your browser
Perform complex queries:use Boolean queries with and, or + and (parentheses)
Find a particular decisionjust enter the decision number into the query + field in the format number/year
Find a words that start with a letter or lettersuse an asterisk eg:word* will find files containing + containing "word", "words" etc
+ Index: /swishctl/example/about.htm =================================================================== --- /swishctl/example/about.htm (revision 1302) +++ /swishctl/example/about.htm (revision 1302) @@ -0,0 +1,25 @@ + + +About SwishCtl + + + + + + + + + + + + +
+

 

About SwishCtl

+

Contents

+

SwishCtl is a search tool based on the swish-e search engine. It is +distributed under the GNU Public License with absolutely no warranty. 

+

+

 

+

 

+ + Index: /swishctl/example/styles/citation.css =================================================================== --- /swishctl/example/styles/citation.css (revision 1232) +++ /swishctl/example/styles/citation.css (revision 1232) @@ -0,0 +1,52 @@ +.SubjectLine +{ + FONT-STYLE: italic +} +.Fact +{ +} +.Held +{ + MARGIN-LEFT: 32pt +} +BODY +{ + BACKGROUND-IMAGE: url(../images/greencurve.gif); + MARGIN-LEFT: 54px; + BACKGROUND-REPEAT: no-repeat; + FONT-FAMILY: Tahoma, Arial; + BACKGROUND-COLOR: #ffffff +} +.DecisionNo +{ + MARGIN-TOP: 56px; + COLOR: red +} +.swquery +{ + FONT-SIZE: 115% +} +.swrescount +{ + FONT-STYLE: italic +} +.swres +{ + FONT-SIZE: 110% +} +.swdesc +{ + FONT-STYLE: italic +} +.Citation +{ + COLOR: red +} +.CaseName +{ + COLOR: red +} +.Judge +{ + COLOR: red +} Index: /swishctl/example/styles/print.css =================================================================== --- /swishctl/example/styles/print.css (revision 1232) +++ /swishctl/example/styles/print.css (revision 1232) @@ -0,0 +1,11 @@ + +BODY +{ + BACKGROUND-COLOR: #ffffff; + BACKGROUND-IMAGE: url(../images/powered.gif); + BACKGROUND-POSITION: center top; + BACKGROUND-REPEAT: no-repeat; + FONT-FAMILY: Tahoma, Arial; + MARGIN-LEFT: 54px; + MARGIN-TOP: 32px +} Index: /swishctl/example/styles/topframe.css =================================================================== --- /swishctl/example/styles/topframe.css (revision 1232) +++ /swishctl/example/styles/topframe.css (revision 1232) @@ -0,0 +1,6 @@ +BODY +{ + BACKGROUND-POSITION: left bottom; + BACKGROUND-IMAGE: url(../images/powered.gif); + BACKGROUND-REPEAT: no-repeat +} Index: /swishctl/example/styles/style.css =================================================================== --- /swishctl/example/styles/style.css (revision 1232) +++ /swishctl/example/styles/style.css (revision 1232) @@ -0,0 +1,26 @@ + +BODY +{ + BACKGROUND-IMAGE: url(../images/powered.gif); + MARGIN-LEFT: 54px; + BACKGROUND-REPEAT: no-repeat; + FONT-FAMILY: Tahoma, Arial; + BACKGROUND-COLOR: #ffffff +} + +.swquery +{ + FONT-SIZE: 115% +} +.swrescount +{ + FONT-STYLE: italic +} +.swres +{ + FONT-SIZE: 110% +} +.swdesc +{ + FONT-STYLE: italic +} Index: /swishctl/example/styles/results.css =================================================================== --- /swishctl/example/styles/results.css (revision 1232) +++ /swishctl/example/styles/results.css (revision 1232) @@ -0,0 +1,33 @@ +BODY +{ + BACKGROUND-IMAGE: url(../images/powered.gif); + MARGIN-LEFT: 54px; + BACKGROUND-REPEAT: no-repeat; + FONT-FAMILY: Tahoma, Arial; + BACKGROUND-COLOR: #ffffff +} +.DecisionNo +{ + MARGIN-TOP: 56px +} +.swquery +{ + FONT-SIZE: 105% +} +.swrescount +{ + FONT-STYLE: italic +} +.swres +{ + FONT-SIZE: 100% +} +.swdesc +{ + COLOR: #000066 +} +.Citation +{ + COLOR: red; + BACKGROUND-COLOR: #336600 +} Index: /swishctl/example/styles/search.css =================================================================== --- /swishctl/example/styles/search.css (revision 1301) +++ /swishctl/example/styles/search.css (revision 1301) @@ -0,0 +1,11 @@ +BODY +{ + FONT-WEIGHT: bold; + BACKGROUND-IMAGE: url(../images/powered.gif); + MARGIN-LEFT: 48px; + COLOR: #ffffff; + BACKGROUND-REPEAT: no-repeat; + FONT-FAMILY: Tahoma, Arial; + font-size: 90%; + BACKGROUND-COLOR: #000066 +} Index: /swishctl/example/body.htm =================================================================== --- /swishctl/example/body.htm (revision 1302) +++ /swishctl/example/body.htm (revision 1302) @@ -0,0 +1,17 @@ + + +About SwishCtl + + + + + + + + + +
+
+ + Index: /swishctl/example/autorun.inf =================================================================== --- /swishctl/example/autorun.inf (revision 1232) +++ /swishctl/example/autorun.inf (revision 1232) @@ -0,0 +1,10 @@ +[autorun] +open=setup.exe +icon=setup.ico +label=SwishCtl Full Text Database +shell\Install\command=setup.exe /F +shell\Install=Install SwishCtl Search... +shell\Uninstall\command=setup.exe /U +shell\Uninstall=Uninstall SwishCtl Search... +shell\Browse\command=explorer.exe index.htm +shell\Browse=Browse Database Index: /swishctl/example/swish.cfg =================================================================== --- /swishctl/example/swish.cfg (revision 1232) +++ /swishctl/example/swish.cfg (revision 1232) @@ -0,0 +1,71 @@ +# ----- Example 1 - limit by extension ------------- +# +# Please see the swish-e documentation for +# information on configuration directives. +# Documentation is included with the swish-e +# distribution, and also can be found on-line +# at http://swish-e.org +# +# +# This example demonstrates how to limit +# indexing to just .htm and .html files. +# +# This particular example (by Greg Ford) is for SwishCtl +#--------------------------------------------------- + + +# By default, swish creates an index file in the current directory +# called "index.swish-e" (and swish uses this name by default when +# searching. This is convenient, but not always desired. + +IndexFile docs.idx + +# don't index the search page +FileRules filename is queryframe\.htm + +# Although you can specify which files or directories to +# index on the command line with -i, it's common to specify +# it here. Note that these are relative to the current directory. + +# Index current directory and +# all sub-directories +# index only files ending in .html and .htm. + +IndexDir . +IndexOnly .htm .html + +# +# a WordCharacters setting for indexing identifiers of form 999/99 +#WordCharacters abcdefghijklmnopqrstuvwxyz0123456789/ + +# If you wish to follow symbolic links use the following. +# Note that the default is "no". I you are indexing many +# files, and you do not have any symbolic links, you may +# still want to set this to "yes". This will avoid an extra +# lstat system call for every file while indexing. + +#FollowSymLinks yes + +#FuzzyIndexingMode Stemming +#UseSoundex yes + +PropertyNames description +PropertyNamesMaxLength 1000 description + +# +#PropertyNames decisionid +#PropertyNamesMaxLength 8 decisionid +# +#PropertyNames year +#PropertyNamesMaxLength 4 year + +#PropertyNameAlias swishdescription description + +#MetaNames description keywords year +MetaNames description keywords + +#StoreDescription HTML +#StoreDescription HTML2 + +# end of example + Index: /swishctl/example/query.htm =================================================================== --- /swishctl/example/query.htm (revision 1302) +++ /swishctl/example/query.htm (revision 1302) @@ -0,0 +1,706 @@ + + + + +SwishCtl Query + + + + + + + + + +
+ + Query:   + + + + + + + + + +   + +  
+ + + + + + + Index: /swishctl/example/index.htm =================================================================== --- /swishctl/example/index.htm (revision 1302) +++ /swishctl/example/index.htm (revision 1302) @@ -0,0 +1,24 @@ + + +Search SWISH-E Documentation + + + + + + + + +<body bgcolor="#FFFFFF"> + +</body> +