//  Beta release only.
//
//  Copyright(c) Ivyware Pty Ltd 2007  (all rights reserved)
//               MELBOURNE, VICTORIA, AUSTRALIA, 3130
//
//  Provided no fee is charged (either by the distributer or user)
//  permission to use, copy, modify, and distribute this software and
//  its documentation for any purpose and without fee is hereby granted,
//  provided that the above copyright notice appear in all copies and
//  that both that copyright notice and this permission notice appear
//  in supporting documentation.
//
//  No waranty or suitablity for purpose is implied.
//
//
//  ODBC extensions
//  NOTES: Exposes definitions for extensions to the ODBC API
//         
//         

#pragma once

#include <Sqlext.h>
#include "P2PmsgODBC.h"
#include "P2Pmsg.h"
#include "ODBC_Ext.h"


//
//
//  Safe SQLHANDLE container
//  NOTES: SQLHANDLE is managed within the life cycle of this object
//
class P2PmsgODBC_EXT SafeSQLHANDLE
{
      void
        RenderThisSafe ( );
    public:
        SafeSQLHANDLE ( );
        SafeSQLHANDLE ( SQLSMALLINT hType, SQLHANDLE hSQL );
       ~SafeSQLHANDLE ( );
    public:
        operator SQLHANDLE ( );
        operator SQLHANDLE* ( );
    public:
      SQLHANDLE
        Deref ( );
    private:
        SQLSMALLINT m_hType;
        SQLHANDLE   m_hHandle;
};

//
//
//  ODBC to P2Pmsg translators
P2PmsgODBC_EXT BOOL
SQLGetData_2_P3PmsgData ( P3PmsgData& oData, SQLSMALLINT iDataType
                        , void *pvValue, SQLINTEGER cbValue );
//P2PmsgODBC_EXT void
//SQLGetData_2_P3PmsgData ( P3PmsgData& oData, SQLSMALLINT iDataType );
