// API.cpp : Implementation of CAPI
#include "stdafx.h"
#include "WWHelp4.h"
#include "API.h"

#include "wwhelp/wwhwin.h"

/////////////////////////////////////////////////////////////////////////////
// CAPI


STDMETHODIMP CAPI::Startup(BSTR BaseURL)
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_Startup(BaseURL);
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::Shutdown()
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_Shutdown();
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelp(BSTR Context, BSTR Topic)
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelp(Context, Topic);
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpWithNavigation(BSTR Context, BSTR Topic)
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpWithNavigation(Context, Topic);
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpWithContents(BSTR Context, BSTR Topic)
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpWithContents(Context, Topic);
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpWithIndex(BSTR Context, BSTR Topic)
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpWithIndex(Context, Topic);
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpWithSearch(BSTR Context, BSTR Topic)
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpWithSearch(Context, Topic);
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpWithFavorites(BSTR Context, BSTR Topic)
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpWithFavorites(Context, Topic);
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpNavigation()
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpNavigation();
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpContents()
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpContents();
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpIndex()
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpIndex();
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpSearch()
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpSearch();
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}

STDMETHODIMP CAPI::DisplayHelpFavorites()
{
  HRESULT  VarReturnCode = E_FAIL;
  int      VarResult;


  VarResult = WWHelp_BSTR_DisplayHelpFavorites();
  if (VarResult == 0)
  {
    // Success!
    //
    VarReturnCode = S_OK;
  }

	return VarReturnCode;
}
