summaryrefslogtreecommitdiff
path: root/comIvy/Expression.h
blob: 454973f7ef3988f53bfba42b13edd5976233f65b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Expression.h : déclaration de CExpression

#pragma once
#include "resource.h"       // symboles principaux

#include "Ivy.h"
#include "IvyCallback.h"

// IExpression
[
	object,
	uuid("65B2CF08-0B15-4752-AEEA-655157A87367"),
	dual,	helpstring("Interface IExpression"),
	pointer_default(unique)
]
__interface IExpression : IDispatch
{
	[id(1), helpstring("method Unbind")] HRESULT Unbind(void);
};


// _IExpressionEvents
[
	dispinterface,
	uuid("74C250EC-2393-452D-9CC4-042313AB7268"),
	helpstring("Interface _IExpressionEvents")
]
__interface _IExpressionEvents
{
	[id(1), helpstring("method Received")] void Received([in] BSTR applicationName, [in] VARIANT arguments);
};


// CExpression

[
	coclass,
	threading("apartment"),
	event_source("com"),
	vi_progid("comIvy.Expression"),
	progid("comIvy.Expression.1"),
	version(2.0),
	uuid("FAD2AFA6-44F7-430A-9344-F20C804DA97B"),
	helpstring("Expression Class")
]
class ATL_NO_VTABLE CExpression : 
	public IExpression,
	public IvyMessageCallback
{
public:
	CExpression();
	~CExpression();

	__event __interface _IExpressionEvents;

	DECLARE_PROTECT_FINAL_CONSTRUCT()

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

public:

	STDMETHOD(Unbind)(void);
	friend class CBus;

protected:
	CBus* bus;
	int id;
	virtual void OnMessage(IvyApplication * app, int argc, const char ** argv);
	STDMETHOD(Bind)(char* regex, CBus* bus );
};