Files
harbour-core/harbour/contrib/hbole/oleinit.c
Viktor Szakats 5bfddcec4d 2009-04-20 08:19 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* utils/hbmk2/hbmk2.prg
    + Added experimental support for header directory autodetection.
      This means that you can pass a list of possible dirs to use
      when a .c header cannot be found in explicitly passed locations.
    ! Fixed to always disable -shared with -hbdyn.
    ! Added hbmaindllp in -hbdyn mode on win|wce.
    ! Fix in -nohbp parameter handling.
    + Added support for macros in -L, -*flag=, -workdir=
    + Added -stop command line parameter which stops execution.
      Can be used in conjunction with arch/comp filters to stop
      execution on certain platforms/compilers.
    ! Fixed to not create workdir in some unlikely combination of options.
    ! Fixed typo causing newer headers not being detected in resource files.
    + Now 'unix' can also be used in filters to check for any *nix platform.
    % Excluding some well-known headers from parsing (windows.h, ole2, os2.h
      currently)
    ; Above changes makes it possible to use hbmk2 to build our contribs.
      The only missing feature is 'install', what is a simple copy.
      ---
      -ohbpgsql

      # just for the sake of an example, not needed for real hbpgsql.
      -stop{dos}

      -inctrypath=${HB_INC_PGSQL}
      -inctrypath={unix}/usr/include
      -inctrypath={unix}/usr/local/pgsql/include
      -inctrypath={unix}/usr/local/pgsql/include/libpq
      -inctrypath={unix}/usr/include/pgsql
      -inctrypath={unix}/usr/include/postgresql
      -inctrypath={unix}/postgres/include
      -inctrypath={unix}/opt/local/include/postgresql83

      postgres.c

      pgrdd.prg
      tpostgre.prg
      ---

  * contrib/hbole/oleinit.c
  * contrib/hbole/hbwinole.h
    * Cleanups in header usage and content. This should fix
      missing hb_oleInit() symbol on some compilers.

  * contrib/examples/pp/hbpptbl.c
    - Removed HB_EXTENSION protected two lines.
2009-04-20 06:27:58 +00:00

84 lines
2.8 KiB
C

/*
* $Id$
*/
/*
* Harbour Project source code:
* OLE initialization
*
* Copyright 2008 Mindaugas Kavaliauskas <dbtopas at dbtopas.lt>
* www - http://www.harbour-project.org
*
* 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, 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbwinole.h"
/*
* Duplicated OleUninitialize() call causes GPF. So, if a few OLE libraries
* is used inside Harbour code, you can expect GPF on application exit.
* This code does not implement any OLE interface except initialization. It is
* have to be used from all other OLE libraries. [Mindaugas]
*/
static int s_iOleInit = 0;
static void hb_ole_exit( void* cargo )
{
HB_SYMBOL_UNUSED( cargo );
if( s_iOleInit )
{
OleUninitialize();
s_iOleInit = 0;
}
}
void hb_oleInit()
{
if( ! s_iOleInit )
{
OleInitialize( NULL );
hb_vmAtQuit( hb_ole_exit, NULL );
}
s_iOleInit++;
}