Changeset 1254

Show
Ignore:
Timestamp:
06/04/03 07:08:12 (5 years ago)
Author:
augur
Message:

Updated SwishCtl? ActiveX Control to link to the new libswish-e-mt multithreaded search library.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/swishctl/src/CSwishCtl.cpp

    r1236 r1254  
    11/* 
     2 
    23 * $Id$ 
     4 
    35 * 
     6 
    47 * SwishCtl - SWISH-E API ActiveX Control 
     8 
    59 * Copyright (c) 2003 Peoples Resource Centre Wellington NZ 
     10 
    611 * 
     12 
    713 * This program is free software; you can redistribute it and/or modify 
     14 
    815 * it under the terms of the GNU General Public License as published by 
     16 
    917 * the Free Software Foundation; either version 2 of the License, or 
     18 
    1019 * (at your option) any later version. 
     20 
    1121 * 
     22 
    1223 * This program is distributed in the hope that it will be useful, 
     24 
    1325 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     26 
    1427 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     28 
    1529 * GNU General Public License for more details. 
     30 
    1631 * 
     32 
    1733 * You should have received a copy of the GNU General Public License 
     34 
    1835 * along with this program; if not, write to the Free Software 
     36 
    1937 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     38 
    2039 */ 
    2140 
     41 
     42 
    2243// CSwishCtl.cpp : Implementation of CCSwishCtl 
     44 
    2345// N.B. can't add swish-e/src to build settings for this project  
     46 
    2447// because the folder contains a string.h which overrides the  
     48 
    2549// default search location for string.h !  
     50 
    2651#include "stdafx.h" 
     52 
    2753#include <string> 
     54 
    2855using namespace std; 
    2956 
    30 #include "../swish-e/src/swish-e.h" 
     57 
     58 
     59#include "swish-e.h" 
     60 
    3161#include "SwishCtl.h" 
     62 
    3263#include "CSwishCtl.h" 
     64 
    3365#include "AnsiBSTR.h" 
     66 
    3467#include "regkey.h" 
    3568 
     69 
     70 
    3671///////////////////////////////////////////////////////////////////////////// 
     72 
    3773// CCSwishCtl 
     74 
    3875CCSwishCtl::CCSwishCtl() 
    39 
     76 
     77
     78 
    4079        swish_handle = NULL; 
     80 
    4181        swish_results = NULL; 
     82 
    4283        current_result = NULL;  
    43 
     84 
     85
     86 
     87 
    4488 
    4589CCSwishCtl::~CCSwishCtl(void) 
    46 
     90 
     91
     92 
    4793         
     94 
    4895        if ( swish_handle ) { 
     96 
    4997        SwishClose( swish_handle );  /* free the memory used */         
    50         } 
    51 
     98 
     99        } 
     100 
     101
     102 
     103 
    52104 
    53105// I didn't know where to put this prototype... 
     106 
    54107// so it can go here for the meantime 
     108 
    55109bool GetModulePath(char filename[ _MAX_PATH ]); 
    56110 
    57111 
     112 
     113 
     114 
    58115STDMETHODIMP CCSwishCtl::Init(BSTR IndexFiles) 
    59 
     116 
     117
     118 
    60119        // In order to claim "safe for scripting",  
     120 
    61121        // don't allow location of resources to be specified  
     122 
    62123        // as a parameter - for this application, the dll must 
     124 
    63125        // and the index files must reside in the same folder 
    64126 
     127 
     128 
    65129        // So now the IndexFiles parameter is the name of a  
     130 
    66131        // registry value in the options key for this app 
    67132 
     133 
     134 
    68135        //BstrConverter bstr_indexfiles(IndexFiles); 
    69136 
     137 
     138 
    70139        const char registrykey[] = "Software\\Kauranga\\ACCIndex\\1.0\\Options"; 
    71140 
     141 
     142 
    72143        CAnsiStr bstr_indexfiles(IndexFiles); 
    73144 
     145 
     146 
    74147        RegKey hkcu(HKEY_LOCAL_MACHINE) ; 
    75148 
    76149 
     150 
     151 
     152 
    77153        string indexfilepath;  
     154 
    78155        string indexfilename;  
    79156 
    80157 
     158 
     159 
     160 
    81161        if (hkcu.OpenKey( registrykey, KEY_QUERY_VALUE )) { 
     162 
    82163                indexfilepath = hkcu.QueryValue( "IndexLocation"  ); 
     164 
    83165                indexfilename = hkcu.QueryValue( "IndexFiles"  ); 
    84         } 
     166 
     167        } 
     168 
    85169                 
    86170 
     171 
     172 
    87173        chdir( indexfilepath.c_str() ); 
    88174 
     175 
     176 
    89177        swish_handle = SwishInit((char *)indexfilename.c_str()); 
     178 
    90179         
     180 
    91181        if ( ! swish_handle ) { 
     182 
    92183                ::MessageBox( NULL, "SwishInit call failed...", indexfilepath.c_str(), MB_OK ); 
     184 
    93185                return E_FAIL; 
    94         } 
     186 
     187        } 
     188 
    95189    if ( SwishError( swish_handle ) )    { 
     190 
    96191                ::MessageBox( NULL, indexfilepath.c_str(), "Swish-e Index File error...", MB_OK ); 
    97192 
     193 
     194 
    98195        SwishClose( swish_handle );  /* free the memory used */         
     196 
    99197                return E_FAIL; 
     198 
    100199    } 
    101200 
     201 
     202 
    102203        swish_search = NULL; 
    103204 
    104         return S_OK; 
    105 
     205 
     206 
     207        return S_OK; 
     208 
     209
     210 
     211 
     212 
    106213 
    107214 
    108215STDMETHODIMP CCSwishCtl::GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) 
    109 
     216 
     217
     218 
    110219   ATLTRACE(_T("CObjectSafetyImpl::GetInterfaceSafetyOptions\n")); 
     220 
    111221   if (!pdwSupportedOptions || !pdwEnabledOptions) 
     222 
    112223           return E_FAIL; 
     224 
    113225   LPUNKNOWN pUnk; 
     226 
    114227   if (_InternalQueryInterface (riid, (void**)&pUnk) == E_NOINTERFACE)  
     228 
    115229   { 
     230 
    116231      // Our object doesn't even support this interface. 
     232 
    117233      return E_NOINTERFACE;    
     234 
    118235   } else { 
     236 
    119237           // Cleanup after ourselves. 
     238 
    120239       pUnk->Release();       
     240 
    121241           pUnk = NULL;    
     242 
    122243   }    
     244 
    123245   if (riid == IID_IDispatch) { 
     246 
    124247      // IDispatch is an interface used for scripting. If your 
     248 
    125249      // control supports other IDispatch or Dual interfaces, you 
     250 
    126251      // may decide to add them here as well. Client wants to know 
     252 
    127253      // if object is safe for scripting. Only indicate safe for 
     254 
    128255      // scripting when the interface is safe. 
     256 
    129257      *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER; 
     258 
    130259      *pdwEnabledOptions = m_dwSafety & 
     260 
    131261                           INTERFACESAFE_FOR_UNTRUSTED_CALLER;       
     262 
    132263          return S_OK; 
     264 
    133265   } else if ((riid == IID_IPersistStreamInit) || 
     266 
    134267             (riid == IID_IPersistStorage))  
     268 
    135269   { 
     270 
    136271      // IID_IPersistStreamInit and IID_IPersistStorage are 
     272 
    137273      // interfaces used for Initialization. If your control 
     274 
    138275      // supports other Persistence interfaces, you may decide to 
     276 
    139277      // add them here as well. Client wants to know if object is 
     278 
    140279      // safe for initializing. Only indicate safe for initializing 
     280 
    141281      // when the interface is safe. 
     282 
    142283      *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA; 
     284 
    143285      *pdwEnabledOptions = m_dwSafety & 
     286 
    144287                           INTERFACESAFE_FOR_UNTRUSTED_DATA; 
     288 
    145289      return S_OK; 
     290 
    146291   } else { 
     292 
    147293          // We are saying that no other interfaces in this control are 
     294 
    148295      // safe for initializing or scripting.       
     296 
    149297          *pdwSupportedOptions = 0; 
     298 
    150299      *pdwEnabledOptions = 0;       
     300 
    151301          return E_FAIL;    
    152         } 
    153 
     302 
     303        } 
     304 
     305
     306 
     307 
    154308 
    155309STDMETHODIMP CCSwishCtl::SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) 
    156 
     310 
     311
     312 
    157313   ATLTRACE(_T("CObjectSafetyImpl::SetInterfaceSafetyOptions\n")); 
     314 
    158315   if (!dwOptionSetMask && !dwEnabledOptions) return E_FAIL;    
    159316 
     317 
     318 
    160319   LPUNKNOWN pUnk; 
     320 
    161321   if (_InternalQueryInterface (riid, (void**)&pUnk) == E_NOINTERFACE)  
     322 
    162323   { 
     324 
    163325      // Our object doesn't even support this interface. 
     326 
    164327      return E_NOINTERFACE;    
     328 
    165329   } else { 
     330 
    166331           // Cleanup after ourselves. 
     332 
    167333       pUnk->Release();       
     334 
    168335           pUnk = NULL;    
     336 
    169337   } 
     338 
    170339   // Store our current safety level to return in    
     340 
    171341   // GetInterfaceSafetyOptions 
     342 
    172343   m_dwSafety |= dwEnabledOptions & dwOptionSetMask; 
     344 
    173345   if ((riid == IID_IDispatch) && 
     346 
    174347       (m_dwSafety & INTERFACESAFE_FOR_UNTRUSTED_CALLER))  
     348 
    175349   { 
     350 
    176351      // Client wants us to disable any functionality that would 
     352 
    177353      // make the control unsafe for scripting. The same applies to 
     354 
    178355      // any other IDispatch or Dual interfaces your control may 
     356 
    179357      // support. Because our control is safe for scripting by 
     358 
    180359      // default we just return S_OK.  
     360 
    181361          return S_OK; 
     362 
    182363   } else if (((riid == IID_IPersistStreamInit) || 
     364 
    183365              (riid == IID_IPersistStorage)) && 
     366 
    184367             (m_dwSafety & INTERFACESAFE_FOR_UNTRUSTED_DATA))  
     368 
    185369   { 
     370 
    186371      // Client wants us to make the control safe for initializing 
     372 
    187373      // from persistent data. For these interfaces, this control 
     374 
    188375      // is safe so we return S_OK. For Any interfaces that are not 
     376 
    189377      // safe, we would return E_FAIL.       
     378 
    190379           return S_OK;    
     380 
    191381   } else { 
     382 
    192383      // This control doesn't allow Initialization or Scripting 
     384 
    193385      // from any other interfaces so return E_FAIL.       
     386 
    194387           return E_FAIL;    
     388 
    195389        }    
    196 
     390 
     391
     392 
     393 
     394 
    197395 
    198396 
    199397STDMETHODIMP CCSwishCtl::Error(int *errcode) 
    200 
     398 
     399
     400 
    201401        *errcode = SwishError( swish_handle ); 
    202         return S_OK; 
    203 
     402 
     403        return S_OK; 
     404 
     405
     406 
     407 
     408 
    204409 
    205410 
    206411STDMETHODIMP CCSwishCtl::Query(BSTR words, int *errcode) 
    207 
     412 
     413
     414 
     415 
    208416 
    209417        HRESULT hresult = NewSearch( words, errcode ); 
    210418 
     419 
     420 
    211421        if ( hresult != S_OK ) return hresult; 
    212422 
     423 
     424 
    213425        return Execute( NULL, errcode );         
    214 
     426 
     427
     428 
     429 
    215430 
    216431STDMETHODIMP CCSwishCtl::ErrorString(BSTR *errstring) 
    217 
     432 
     433
     434 
    218435        if ( ! swish_handle ) {  
     436 
    219437                return E_FAIL; 
    220         } 
     438 
     439        } 
     440 
     441 
    221442 
    222443        char *err = SwishErrorString(swish_handle); 
     444 
    223445         
     446 
    224447        CAnsiBSTR bstrTemp( err ); 
    225448 
     449 
     450 
    226451    if (!bstrTemp) 
     452 
    227453           return E_OUTOFMEMORY; 
     454 
    228455  
     456 
    229457        *errstring = bstrTemp.Detach(); 
    230         return S_OK; 
    231 
     458 
     459        return S_OK; 
     460 
     461
     462 
     463 
    232464 
    233465STDMETHODIMP CCSwishCtl::Hits(int *hits) 
    234 
     466 
     467
     468 
    235469        if (! swish_results ) return E_FAIL; 
     470 
    236471        *hits = SwishHits( swish_results ); 
    237         return S_OK; 
    238 
     472 
     473        return S_OK; 
     474 
     475
     476 
     477 
    239478 
    240479STDMETHODIMP CCSwishCtl::NextResult(int *more) 
    241 
     480 
     481
     482 
    242483        *more = FALSE; 
     484 
    243485        if (!swish_results) return E_FAIL; 
    244486 
     487 
     488 
    245489        current_result = SwishNextResult( swish_results ); 
     490 
    246491        if ( current_result ) *more = TRUE; 
     492 
    247493         
    248         return S_OK; 
    249 
     494 
     495        return S_OK; 
     496 
     497
     498 
     499 
     500 
    250501 
    251502 
    252503STDMETHODIMP CCSwishCtl::ResultPropertyString( 
     504 
    253505                                        BSTR propertyname, BSTR *result) 
    254 
     506 
     507
     508 
     509 
     510 
    255511 
    256512 
    257513        CAnsiStr bstr_convert(propertyname); 
    258514 
     515 
     516 
    259517        char *propertyval = SwishResultPropertyStr( 
     518 
    260519                current_result, bstr_convert.c_str()); 
    261520 
     521 
     522 
    262523        CAnsiBSTR bstrTemp( propertyval ); 
    263524 
     525 
     526 
    264527    if (!bstrTemp) 
     528 
    265529           return E_OUTOFMEMORY; 
     530 
    266531  
     532 
    267533        *result = bstrTemp.Detach(); 
    268534 
    269         return S_OK; 
    270  
    271 
     535 
     536 
     537        return S_OK; 
     538 
     539 
     540 
     541
     542 
     543 
    272544 
    273545STDMETHODIMP CCSwishCtl::Close() 
    274 
     546 
     547
     548 
    275549        current_result = NULL; 
     550 
    276551        if ( swish_handle ) { 
     552 
    277553                if ( swish_results ) { 
     554 
    278555                        Free_Results_Object( swish_results ); 
     556 
    279557                        swish_results = NULL; 
     558 
    280559                } 
     560 
    281561                if (swish_search) { 
     562 
    282563                        Free_Search_Object( swish_search ); 
     564 
    283565                        swish_search = NULL; 
     566 
    284567                } 
     568 
    285569        SwishClose( swish_handle );  /* free the memory used */         
     570 
    286571                swish_handle = NULL; 
    287         } 
    288  
    289         return S_OK; 
    290 
     572 
     573        } 
     574 
     575 
     576 
     577        return S_OK; 
     578 
     579
     580 
     581 
    291582 
    292583STDMETHODIMP CCSwishCtl::SeekResult(int position, int *result) 
    293 
     584 
     585
     586 
    294587        *result = -1; // an error 
     588 
    295589        if (!swish_results) return S_OK; 
    296590 
     591 
     592 
    297593        *result = SwishSeekResult( swish_results, position ); 
     594 
    298595         
    299         return S_OK; 
    300 
     596 
     597        return S_OK; 
     598 
     599
     600 
     601 
    301602 
    302603STDMETHODIMP CCSwishCtl::SetSort(BSTR sort) 
    303 
     604 
     605
     606 
    304607        if ( ! (swish_handle && swish_search) ){  
     608 
    305609                return E_FAIL; 
    306         } 
     610 
     611        } 
     612 
     613 
    307614 
    308615        CAnsiStr bstr_sort( sort ); 
    309616 
     617 
     618 
    310619        SwishSetSort( swish_search, bstr_sort.c_str() ); 
    311620 
    312         return S_OK; 
    313 
     621 
     622 
     623        return S_OK; 
     624 
     625
     626 
     627 
     628 
    314629 
    315630 
    316631STDMETHODIMP CCSwishCtl::NewSearch(BSTR query, int *errcode) 
    317 
     632 
     633
     634 
    318635        *errcode = -1;  
     636 
    319637        if ( ! swish_handle ) {  
     638 
    320639                ::MessageBox( NULL, "swish_handle is null...", "New Search", MB_OK ); 
     640 
    321641                return E_FAIL; 
    322         } 
     642 
     643        } 
     644 
    323645        CAnsiStr bstr_query( query ); 
    324646 
     647 
     648 
    325649        if ( swish_results ) { 
     650 
    326651                Free_Results_Object(swish_results); 
     652 
    327653                swish_results = NULL; 
    328         } 
     654 
     655        } 
     656 
     657 
    329658 
    330659        if ( swish_search ) { 
     660 
    331661                Free_Search_Object( swish_search ); 
    332         } 
     662 
     663        } 
     664 
    333665        swish_search = New_Search_Object( swish_handle, bstr_query.c_str() ); 
    334666 
    335667 
     668 
     669 
     670 
    336671        SwishResetSearchLimit( swish_search ); 
    337672 
     673 
     674 
    338675        if ( ! swish_search ) { 
     676 
    339677                ::MessageBox( NULL, "swish_search is null...", "Error", MB_OK ); 
    340         } 
     678 
     679        } 
     680 
     681 
    341682 
    342683        *errcode = SwishError( swish_handle ); 
    343684 
    344         return S_OK; 
    345 
     685 
     686 
     687        return S_OK; 
     688 
     689
     690 
     691 
    346692 
    347693STDMETHODIMP CCSwishCtl::Execute(BSTR words, int *errcode) 
    348 
     694 
     695
     696 
    349697        *errcode = -1;  
     698 
    350699        if ( ! swish_handle ) { 
     700 
    351701                 
     702 
    352703                return E_FAIL; 
    353         } 
     704 
     705        } 
     706 
     707 
    354708 
    355709        if ( !words ) { 
     710 
    356711                // use existing query string - no need to convert string 
     712 
    357713                swish_results = SwishExecute( swish_search, NULL ); 
     714 
    358715                *errcode = SwishError( swish_handle ); 
     716 
    359717                return S_OK; 
     718 
    360719        }        
     720 
    361721        CAnsiStr bstr_words( words ); 
     722 
    362723        swish_results = SwishExecute( swish_search, bstr_words.c_str() ); 
    363724 
     725 
     726 
    364727        *errcode = SwishError( swish_handle ); 
    365728 
    366         return S_OK; 
    367 
     729 
     730 
     731        return S_OK; 
     732 
     733
     734 
     735 
     736 
     737 
    368738 
    369739 
    370740 
    371741STDMETHODIMP CCSwishCtl::SetSearchLimit(BSTR propertyname, BSTR low, BSTR hi) 
    372 
     742 
     743
     744 
    373745        if ( ! (swish_handle && swish_search) ){  
     746 
    374747                return E_FAIL; 
    375         } 
     748 
     749        } 
     750 
    376751        CAnsiStr bstr_propertyname(propertyname); 
     752 
    377753        CAnsiStr bstr_low(low); 
     754 
    378755        CAnsiStr bstr_hi(hi); 
    379756 
     757 
     758 
    380759        SwishSetSearchLimit( swish_search,  
     760 
    381761                bstr_propertyname.c_str(),  
     762 
    382763                bstr_low.c_str(), 
     764 
    383765                bstr_hi.c_str() ); 
    384         return S_OK; 
    385 
    386  
     766 
     767        return S_OK; 
     768 
     769
     770 
     771 
     772 
  • trunk/swishctl/src/SwishCtl.cpp

    r1236 r1254  
    11/* 
     2 
    23 * $Id$ 
    3  * 
     4 
     5 * 
     6 
    47 * SwishCtl - SWISH-E API ActiveX Control 
     8 
    59 * Copyright (c) 2003 Peoples Resource Centre Wellington NZ 
    6  * 
     10 
     11 * 
     12 
    713 * This program is free software; you can redistribute it and/or modify 
     14 
    815 * it under the terms of the GNU General Public License as published by 
     16 
    917 * the Free Software Foundation; either version 2 of the License, or 
     18 
    1019 * (at your option) any later version. 
    11  * 
     20 
     21 * 
     22 
    1223 * This program is distributed in the hope that it will be useful, 
     24 
    1325 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     26 
    1427 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     28 
    1529 * GNU General Public License for more details. 
    16  * 
     30 
     31 * 
     32 
    1733 * You should have received a copy of the GNU General Public License 
     34 
    1835 * along with this program; if not, write to the Free Software 
     36 
    1937 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     38 
    2039 */ 
    2140 
     41 
     42 
    2243// SwishCtl.cpp : Implementation of DLL Exports. 
    2344 
    2445 
     46 
     47 
     48 
    2549// Note: Proxy/Stub Information 
     50 
    2651//      To build a separate proxy/stub DLL,  
     52 
    2753//      run nmake -f SwishCtlps.mk in the project directory. 
    2854 
     55 
     56 
    2957#include "stdafx.h" 
     58 
    3059#include "resource.h" 
     60 
    3161#include <initguid.h> 
     62 
    3263#include "SwishCtl.h" 
    3364 
     65 
     66 
    3467#include "SwishCtl_i.c" 
    35 #include "../swish-e/src/swish-e.h" 
     68 
     69#include "swish-e.h" 
     70 
     71 
    3672 
    3773#include "CSwishCtl.h" 
    3874 
     75 
     76 
    3977CComModule _Module; 
    4078 
     79 
     80 
    4181BEGIN_OBJECT_MAP(ObjectMap) 
     82 
    4283OBJECT_ENTRY(CLSID_CSwishCtl, CCSwishCtl) 
     84 
    4385END_OBJECT_MAP() 
    4486 
    4587 
     88 
     89 
     90 
    4691bool GetModulePath(char filename[ _MAX_PATH ]) 
    47 
     92 
     93
     94 
    4895                 
     96 
    4997        DWORD result = GetModuleFileName( _Module.m_hInst, filename,  _MAX_PATH ); 
     98 
    5099        if ( result > 0 ) { 
     100 
    51101                char drive [_MAX_DIR ];  
     102 
    52103                char dir [_MAX_PATH ];   
     104 
    53105                _splitpath( filename, drive, dir, NULL, NULL); 
     106 
    54107                _makepath( filename, drive, dir, NULL, NULL ); 
     108 
    55109                return true; 
     110 
    56111        } 
     112 
    57113        return false; 
    58 
    59  
    60 ///////////////////////////////////////////////////////////////////////////// 
     114 
     115
     116 
     117 
     118 
     119///////////////////////////////////////////////////////////////////////////// 
     120 
    61121// DLL Entry Point 
    62122 
     123 
     124 
    63125extern "C" 
     126 
    64127BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) 
    65 
     128 
     129
     130 
    66131    if (dwReason == DLL_PROCESS_ATTACH) 
     132 
    67133    { 
     134 
    68135        _Module.Init(ObjectMap, hInstance, &LIBID_SWISHCTLLib); 
     136 
    69137        DisableThreadLibraryCalls(hInstance); 
     138 
    70139    } 
     140 
    71141    else if (dwReason == DLL_PROCESS_DETACH) 
     142 
    72143        _Module.Term(); 
     144 
    73145    return TRUE;    // ok 
    74 
    75  
    76 ///////////////////////////////////////////////////////////////////////////// 
     146 
     147
     148 
     149 
     150 
     151///////////////////////////////////////////////////////////////////////////// 
     152 
    77153// Used to determine whether the DLL can be unloaded by OLE 
    78154 
     155 
     156 
    79157STDAPI DllCanUnloadNow(void) 
    80 
     158 
     159
     160 
    81161    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; 
    82 
    83  
    84 ///////////////////////////////////////////////////////////////////////////// 
     162 
     163
     164 
     165 
     166 
     167///////////////////////////////////////////////////////////////////////////// 
     168 
    85169// Returns a class factory to create an object of the requested type 
    86170 
     171 
     172 
    87173STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) 
    88 
     174 
     175
     176 
    89177    return _Module.GetClassObject(rclsid, riid, ppv); 
    90 
    91  
    92 ///////////////////////////////////////////////////////////////////////////// 
     178 
     179
     180 
     181 
     182 
     183///////////////////////////////////////////////////////////////////////////// 
     184 
    93185// DllRegisterServer - Adds entries to the system registry 
    94186 
     187 
     188 
    95189STDAPI DllRegisterServer(void) 
    96 
     190 
     191
     192 
    97193    // registers object, typelib and all interfaces in typelib 
    98194 
     195 
     196 
    99197    return _Module.RegisterServer(TRUE); 
    100 
    101  
    102 ///////////////////////////////////////////////////////////////////////////// 
     198 
     199
     200 
     201 
     202 
     203///////////////////////////////////////////////////////////////////////////// 
     204 
    103205// DllUnregisterServer - Removes entries from the system registry 
    104206 
     207 
     208 
    105209STDAPI DllUnregisterServer(void) 
    106 
     210 
     211
     212 
    107213    return _Module.UnregisterServer(TRUE); 
    108 
    109  
    110  
     214 
     215
     216 
     217 
     218 
     219 
     220 
  • trunk/swishctl/src/SwishCtl.dsp

    r1237 r1254  
    5252LINK32=link.exe 
    5353# 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 
    54 # 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 ../../swish-e/src/win32/libswish-e.lib ../../zlib/zlib.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept 
    55 # Begin Custom Build - Performing registration 
    56 OutDir=.\Debug 
    57 TargetPath=.\Debug\SwishCtl.dll 
    58 InputPath=.\Debug\SwishCtl.dll 
    59 SOURCE="$(InputPath)" 
    60  
    61 "$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" 
    62         regsvr32 /s /c "$(TargetPath)"  
    63         echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"  
    64          
    65 # End Custom Build 
     54# ADD LINK32 kernel32.lib ../../swish-e/src/win32/libswish-e-mt.lib ../../zlib/lib/zlib.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept 
    6655 
    6756!ELSEIF  "$(CFG)" == "SwishCtl - Win32 Release MinSize" 
     
    8776LINK32=link.exe 
    8877# 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 
    89 # 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 ../../swish-e/src/win32/libswishsearch.lib ../../zlib/zlib.lib /nologo /subsystem:windows /dll /machine:I386 /out:"../SwishCtl.dll" 
     78# ADD LINK32 kernel32.lib ../../swish-e/src/win32/libswish-e-mt.lib ../../zlib/lib/zlib.lib /nologo /subsystem:windows /dll /machine:I386 /out:"../SwishCtl.dll" 
    9079# SUBTRACT LINK32 /nodefaultlib 
    91 # Begin Custom Build - Performing registration 
    92 OutDir=.\ReleaseMinSize 
    93 TargetPath=\projects\swish\win32\swishctl\SwishCtl.dll 
    94 InputPath=\projects\swish\win32\swishctl\SwishCtl.dll 
    95 SOURCE="$(InputPath)" 
    96  
    97 "$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" 
    98         regsvr32 /s /c "$(TargetPath)"  
    99         echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"  
    100          
    101 # End Custom Build 
    10280 
    10381!ENDIF  
  • trunk/swishctl/src/SwishCtl.dsw

    r1232 r1254  
    11Microsoft Developer Studio Workspace File, Format Version 6.00 
     2 
    23# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 
     4 
     5 
    36 
    47############################################################################### 
    58 
     9 
     10 
    611Project: "SwishCtl"=.\SwishCtl.dsp - Package Owner=<4> <