51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
// Options.cpp : Implementation of COptions
|
|
|
|
#include "stdafx.h"
|
|
#include "Options.h"
|
|
|
|
CSLNKOptions g_SLNKOptions; // The one and only
|
|
|
|
// Set all default values
|
|
CSLNKOptions::CSLNKOptions()
|
|
{
|
|
m_MinContSize = 0.20e6; // Minimale grootte voor een contour om herkend te worden
|
|
m_SkipContLeader = FALSE; // ARKEY tekeningen hebben een leading lijntje voor de contour
|
|
}
|
|
// COptions
|
|
|
|
STDMETHODIMP COptions::InterfaceSupportsErrorInfo(REFIID riid)
|
|
{
|
|
static const IID* arr[] =
|
|
{
|
|
&IID_IOptions
|
|
};
|
|
|
|
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
|
|
{
|
|
if (InlineIsEqualGUID(*arr[i],riid))
|
|
return S_OK;
|
|
}
|
|
return S_FALSE;
|
|
}
|
|
|
|
STDMETHODIMP COptions::SetOption(BSTR optionName, VARIANT OptionValue)
|
|
{
|
|
CComVariant val(OptionValue);
|
|
CString nm(optionName);
|
|
nm.MakeUpper();
|
|
|
|
if (nm=="MINCONTSIZE")
|
|
{
|
|
HRESULT hr = val.ChangeType(VT_R8);
|
|
if (FAILED(hr)) return hr;
|
|
g_SLNKOptions.m_MinContSize = val.dblVal;
|
|
}
|
|
if (nm=="SKIPCONTLEADER")
|
|
{
|
|
HRESULT hr = val.ChangeType(VT_BOOL);
|
|
if (FAILED(hr)) return hr;
|
|
g_SLNKOptions.m_SkipContLeader = val.boolVal;
|
|
}
|
|
return S_OK;
|
|
}
|