//
//  Beta release only.
//
//  Copyright(c) Ivyware Pty Ltd 2013  (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.
//
//
//  SQLmapi service definitions and prototypes
//  NOTES:
//         
#pragma once

#include "P2PeerService.h"

//
//  P2PeerService class
//  NOTES: Intercepts and displays results for ExecuteSQL and
//         ExecuteSP messages.  Such P2PeerMsg's must be intercepted
//         asynchronously.  Something a traditional Console app does
//         not do very well.
//
class SQLmapi : public P2PeerService
{
      void
        RenderThisSafe();

    // Constructors and destructor
    public:
        SQLmapi ( LPCTSTR lpszServicename, LPSERVICE_MAIN_FUNCTION
                , LPHANDLER_FUNCTION );
      virtual
       ~SQLmapi ( );

    // Argument processing
    public:
      bool
        ServiceMainArgs ( LPTSTR argv[], DWORD& argn, bool bImplement );
      bool
        HelpMainArgs ( LPTSTR argv[], DWORD& argn, bool bImplement );
      //int
      //  Run ( );
      int
        RunAsConsole ( );
      virtual int
        RunConsoleModeAttachment ( );

    // Service control operations
    //DWORD
    //  OnPause ( void );
    //DWORD
    //  OnContinue ( void );
    //void
    //  OnStop ( void );
    //void
    //  OnShutdown ( void );
    //void
    //  OnInquire ( void );
    //void
    //  OnUserControl ( DWORD usercmd );

    // Attributes
    private:
      short    m_nIPort;
};
