//$$---- Source du contrôle ActiveX ---- (stActiveXControlSource)
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include <atl\atlvcl.h>

#include "DLPrinterPortIOXImpl1.h"
#include "About1.h"
//---------------------------------------------------------------------------
#pragma link "DLPrinterPortIOX"
#pragma package(smart_init)
STDMETHODIMP TDLPrinterPortIOXXImpl::AboutBox()
{
  try
  {
  ShowDLPrinterPortIOCXAbout();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::DrawTextBiDiModeFlagsReadingOnly(
  long* Value)
{
  try
  {
  *Value = m_VclCtl->DrawTextBiDiModeFlagsReadingOnly();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_AlignDisabled(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->AlignDisabled;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_DoubleBuffered(
  VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->DoubleBuffered;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_Enabled(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->Enabled;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTAckwl(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->LPTAckwl;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTBasePort(long* Value)
{
  try
  {
   *Value = (long)(m_VclCtl->LPTBasePort);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTBusy(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->LPTBusy;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTError(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->LPTError;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTNumber(short* Value)
{
  try
  {
   *Value = (short)(m_VclCtl->LPTNumber);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTNumPorts(short* Value)
{
  try
  {
   *Value = (short)(m_VclCtl->LPTNumPorts);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTPaperEnd(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->LPTPaperEnd;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_LPTSlct(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->LPTSlct;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_Visible(VARIANT_BOOL* Value)
{
  try
  {
   *Value = m_VclCtl->Visible;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::get_VisibleDockClientCount(
  long* Value)
{
  try
  {
   *Value = (long)(m_VclCtl->VisibleDockClientCount);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::GetPin(short index,
  VARIANT_BOOL* Value)
{
  try
  {
  *Value = m_VclCtl->GetPin(index);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::InitiateAction()
{
  try
  {
  m_VclCtl->InitiateAction();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::IsRightToLeft(VARIANT_BOOL* Value)
{
  try
  {
  *Value = m_VclCtl->IsRightToLeft();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::LPTAutofd(VARIANT_BOOL Flag)
{
  try
  {
  m_VclCtl->LPTAutofd(Flag);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::LPTInit()
{
  try
  {
  m_VclCtl->LPTInit();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::LPTPrintChar(short CH,
  VARIANT_BOOL* Value)
{
  try
  {
  *Value = m_VclCtl->LPTPrintChar(CH);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::LPTSlctIn()
{
  try
  {
  m_VclCtl->LPTSlctIn();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::LPTStrobe()
{
  try
  {
  m_VclCtl->LPTStrobe();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::ReadPort(long Address, short* Value)
{
  try
  {
  *Value = m_VclCtl->ReadPort(Address);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::set_DoubleBuffered(VARIANT_BOOL Value)
{
  try
  {
    const DISPID dispid = 18;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->DoubleBuffered = Value;
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::set_Enabled(VARIANT_BOOL Value)
{
  try
  {
    const DISPID dispid = -514;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->Enabled = Value;
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::set_LPTNumber(short Value)
{
  try
  {
    const DISPID dispid = 16;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->LPTNumber = (char)(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::set_Visible(VARIANT_BOOL Value)
{
  try
  {
    const DISPID dispid = 29;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->Visible = Value;
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::SetPin(short index,
  VARIANT_BOOL state)
{
  try
  {
  m_VclCtl->SetPin(index, state);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::SetSubComponent(
  VARIANT_BOOL IsSubComponent)
{
  try
  {
  m_VclCtl->SetSubComponent(IsSubComponent);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::UseRightToLeftReading(
  VARIANT_BOOL* Value)
{
  try
  {
  *Value = m_VclCtl->UseRightToLeftReading();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::UseRightToLeftScrollBar(
  VARIANT_BOOL* Value)
{
  try
  {
  *Value = m_VclCtl->UseRightToLeftScrollBar();
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


STDMETHODIMP TDLPrinterPortIOXXImpl::WritePort(long Address, short Data)
{
  try
  {
  m_VclCtl->WritePort(Address, Data);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IDLPrinterPortIOXX);
  }
  return S_OK;
};


