// BinaryOperations.h : Deklaracja CBinaryOperations

#pragma once
#include "resource.h"       // główne symbole


// IBinaryOperations
[
	object,
	uuid("A97FA542-592B-4F2B-8BB2-CD11327FD717"),
	dual,	helpstring("Interfejs IBinaryOperations"),
	pointer_default(unique)
]
__interface IBinaryOperations : IDispatch
{
	[id(1), helpstring("metoda Add")] HRESULT Add([in] FLOAT a, [in] FLOAT b, [out,retval] FLOAT* result);
	[id(2), helpstring("metoda Subtract")] HRESULT Subtract([in] FLOAT a, [in] FLOAT b, [out,retval] FLOAT* result);
	[id(3), helpstring("metoda Multiply")] HRESULT Multiply([in] FLOAT a, [in] FLOAT b, [out,retval] FLOAT* result);
	[id(4), helpstring("metoda Divide")] HRESULT Divide([in] FLOAT a, [in] FLOAT b, [out,retval] FLOAT* result);
};



// CBinaryOperations

[
	coclass,
	threading("apartment"),
	vi_progid("Arithmetic.BinaryOperations"),
	progid("Arithmetic.BinaryOperations.1"),
	version(1.0),
	uuid("800ABFE5-6373-4951-AA58-AB437BE73254"),
	helpstring("Klasa BinaryOperations")
]
class ATL_NO_VTABLE CBinaryOperations : 
	public IBinaryOperations
{
public:
	CBinaryOperations()
	{
	}


	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}

public:

	STDMETHOD(Add)(FLOAT a, FLOAT b, FLOAT* result);
	STDMETHOD(Subtract)(FLOAT a, FLOAT b, FLOAT* result);
	STDMETHOD(Multiply)(FLOAT a, FLOAT b, FLOAT* result);
	STDMETHOD(Divide)(FLOAT a, FLOAT b, FLOAT *result);
};

