Click here to Skip to main content
15,894,825 members
Articles / Desktop Programming / ATL

An Example of ATL 7.0 ActiveX Control Simulating A PS (Particle Swarm) Dynamic System

Rate me:
Please Sign up or sign in to vote.
3.86/5 (4 votes)
14 Nov 20047 min read 53K   1.6K   34  
An article on ATL 7.0 and dynamic system simulation.
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\prsht.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtml.idl";
import "e:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\dimm.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtmhst.idl";
import "e:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\docobj.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\exdisp.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\objsafe.idl";

#line 9 "c:\\smartgravitybubblectrl\\smartbubble.h"
enum _EnumSmartBubbleShape {
	Circle = 0,
	RoundedRect = 1,
	TextOnly = 2,
};

#line 17 "c:\\smartgravitybubblectrl\\smartbubble.h"
typedef enum _EnumSmartBubbleShape EnumSmartBubbleShape;

[
	object,
	uuid(07E177F0-CB10-4ED1-ABEF-8C977373194B),
	dual,
	helpstring("ISmartBubble interface"),
	pointer_default(unique)
] 
#line 26 "c:\\smartgravitybubblectrl\\smartbubble.h"
interface ISmartBubble : IDispatch {
#line 28 "c:\\smartgravitybubblectrl\\smartbubble.h"
	[propget,id(1),helpstring("property  ID")] HRESULT  ID([out,retval] LONG *pVal);
	[propput,id(1),helpstring("property  ID")] HRESULT  ID([in] LONG newVal);
	[propget,id(2),helpstring("property  Shape")] HRESULT  Shape([out,retval] EnumSmartBubbleShape *pVal);
	[propput,id(2),helpstring("property  Shape")] HRESULT  Shape([in] EnumSmartBubbleShape newVal);
	[propget,id(3),helpstring("property  Text")] HRESULT  Text([out,retval] BSTR *pVal );
	[propput,id(3),helpstring("property  Text")] HRESULT  Text([in] BSTR newVal);
	[propget,id(4),helpstring("property  Weight")] HRESULT  Weight([out,retval] DOUBLE *pVal);
	[propput,id(4),helpstring("property  Weight")] HRESULT  Weight([in] DOUBLE newVal);
	[propget,id(5),helpstring("property  ElectronicCharge")] HRESULT  ElectronicCharge([out,retval] DOUBLE *pVal);
	[propput,id(5),helpstring("property  ElectronicCharge")] HRESULT  ElectronicCharge([in] DOUBLE newVal);
	[propget,id(6),helpstring("property  Fixed")] HRESULT  Fixed([out,retval] VARIANT_BOOL *pVal);
	[propput,id(6),helpstring("property  Fixed")] HRESULT  Fixed([in] VARIANT_BOOL newVal);
	[propget,id(7),helpstring("property  xPos")] HRESULT  xPos([out,retval] DOUBLE *pVal);
	[propput,id(7),helpstring("property  xPos")] HRESULT  xPos([in] DOUBLE newVal);
	[propget,id(8),helpstring("property  yPos")] HRESULT  yPos([out,retval] DOUBLE *pVal);
	[propput,id(8),helpstring("property  yPos")] HRESULT  yPos([in] DOUBLE newVal);
	[propget,id(9),helpstring("property  Color")] HRESULT  Color([out,retval] OLE_COLOR *pVal);
	[propput,id(9),helpstring("property  Color")] HRESULT  Color([in] OLE_COLOR newVal);
	[propget,id(10),helpstring("property  Width")] HRESULT  Width([out,retval] LONG *pVal);
	[propput,id(10),helpstring("property  Width")] HRESULT  Width([in] LONG newVal);
	[propget,id(11),helpstring("property  Height")] HRESULT  Height([out,retval] LONG *pVal);
	[propput,id(11),helpstring("property  Height")] HRESULT  Height([in] LONG newVal);
	[propget,id(12),helpstring("property  xSpeed")] HRESULT  xSpeed([out,retval] DOUBLE *pVal);
	[propput,id(12),helpstring("property  xSpeed")] HRESULT  xSpeed([in] DOUBLE newVal);
	[propget,id(13),helpstring("property  ySpeed")] HRESULT  ySpeed([out,retval] DOUBLE *pVal);
	[propput,id(13),helpstring("property  ySpeed")] HRESULT  ySpeed([in] DOUBLE newVal);
	[propget,id(14),helpstring("property  Stopped")] HRESULT  Stopped([out,retval] VARIANT_BOOL *pVal);
	[propput,id(14),helpstring("property  Stopped")] HRESULT  Stopped([in] VARIANT_BOOL newVal);
	[propget,id(15),helpstring("property  TextColor")] HRESULT  TextColor([out,retval] OLE_COLOR *pVal);
	[propput,id(15),helpstring("property  TextColor")] HRESULT  TextColor([in] OLE_COLOR newVal);
	[propget,id(16),helpstring("property  TextHightlightColor")] HRESULT  TextHighlightColor([out,retval] OLE_COLOR *pVal);
	[propput,id(16),helpstring("property  TextHightlightColor")] HRESULT  TextHighlightColor([in] OLE_COLOR newVal);
	[propget,id(17),helpstring("property  Highlighted")] HRESULT  Highlighted([out,retval] VARIANT_BOOL *pVal);
	[propput,id(17),helpstring("property  Highlighted")] HRESULT  Highlighted([in] VARIANT_BOOL newVal);
	[propget,id(18),helpstring("property  HighlightColor")] HRESULT  HighlightColor([out,retval] OLE_COLOR *pVal);
	[propput,id(18),helpstring("property  HighlightColor")] HRESULT  HighlightColor([in] OLE_COLOR newVal);
	[propget,id(19),helpstring("property  Picture")] HRESULT  Picture([out,retval] IPictureDisp **pVal );
	[propput,id(19),helpstring("property  Picture")] HRESULT  Picture([in] IPictureDisp *newVal);
};

[
	object,
	uuid(332781CD-76BD-11D3-BAB1-00C04F8EC847),
	helpstring("IAtlEventSink Interface"),
	pointer_default(unique)
] 
#line 25 "c:\\smartgravitybubblectrl\\vcue_stockproperty.h"
interface IAtlEventSink : IUnknown {
#line 27 "c:\\smartgravitybubblectrl\\vcue_stockproperty.h"
	HRESULT  Advise([in] IUnknown *pSrc);
	HRESULT  Unadvise();
};

[
	object,
	uuid(A46F8D32-1925-405B-A678-6555D8BEA018),
	dual,
	helpstring("ISmartGravityBubble interface"),
	pointer_default(unique)
] 
#line 25 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
interface ISmartGravityBubble : IDispatch {
#line 28 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	[propputref,bindable,requestedit,id((-512))] HRESULT  Font([in] IFontDisp *pFont);
#line 30 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	[propput,bindable,requestedit,id((-512))] HRESULT  Font([in] IFontDisp *pFont);
#line 32 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	[propget,bindable,requestedit,id((-512))] HRESULT  Font([out,retval] IFontDisp **ppFont );
#line 34 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	[propputref,id((-523))] HRESULT  Picture([in] IPictureDisp *pPicture);
#line 36 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	[propput,id((-523))] HRESULT  Picture([in] IPictureDisp *pPicture);
#line 38 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	[propget,id((-523))] HRESULT  Picture([out,retval] IPictureDisp **ppPicture );
#line 40 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	[propget,id(1),helpstring("property  GravityPara")] HRESULT  GravityPara([out,retval] DOUBLE *pVal);
	[propput,id(1),helpstring("property  GravityPara")] HRESULT  GravityPara([in] DOUBLE newVal);
	[propget,id(2),helpstring("property  ChargePara")] HRESULT  ChargePara([out,retval] DOUBLE *pVal);
	[propput,id(2),helpstring("property  ChargePara")] HRESULT  ChargePara([in] DOUBLE newVal);
	[propget,id(3),helpstring("property  Started")] HRESULT  Started([out,retval] VARIANT_BOOL *pVal);
	[propput,id(3),helpstring("property  Started")] HRESULT  Started([in] VARIANT_BOOL newVal);
	[id(4),helpstring("method AddBubble")] HRESULT  AddBubble([in]ISmartBubble *pBubble);
	[id(5),helpstring("method DeleteBubble")] HRESULT  DeleteBubble([in]LONG ID);
	[id(6),helpstring("method GetBubble")] HRESULT  GetBubble([in]LONG ID, [out,retval] ISmartBubble **pBubble );
	[propget,id(7),bindable,helpstring("property  TimerInterval")] HRESULT  TimerInterval([out,retval] LONG *pVal);
	[propput,id(7),bindable,helpstring("property  TimerInterval")] HRESULT  TimerInterval([in] LONG newVal);
	[propget,id(8),bindable,helpstring("property  DumpPara")] HRESULT  DumpPara([out,retval] DOUBLE *pVal);
	[propput,id(8),bindable,helpstring("property  DumpPara")] HRESULT  DumpPara([in] DOUBLE newVal);
	[propget,id(9),bindable,helpstring("property  MinSpeed")] HRESULT  MinSpeed([out,retval] DOUBLE *pVal);
	[propput,id(9),bindable,helpstring("property  MinSpeed")] HRESULT  MinSpeed([in] DOUBLE newVal);
	[propget,id(10),bindable,helpstring("property  MinASpeed")] HRESULT  MinASpeed([out,retval] DOUBLE *pVal);
	[propput,id(10),bindable,helpstring("property  MinASpeed")] HRESULT  MinASpeed([in] DOUBLE newVal);
	[propget,id(11),bindable,requestedit,helpstring("property  BackColor")] HRESULT  BackColor([out,retval] OLE_COLOR *pVal);
	[propput,id(11),bindable,requestedit,helpstring("property  BackColor")] HRESULT  BackColor([in] OLE_COLOR newVal);
	[id(12),helpstring("method EmptyBubbles")] HRESULT  EmptyBubbles();
};


[ version(1.0), uuid(C3BEF969-9823-47A8-989D-BF20F873FDCB), helpstring("SmartGravityBubbleCtrl 1.0 typelib") ]
library SmartGravityBubbleCtrl
{
	importlib("stdole2.tlb");
	importlib("olepro32.dll");

	[
		version(1.0),
		uuid(499DE7D9-DDD7-4396-86BB-F718A1BDA029),
		helpstring("SmartBubble Class")
	] 
#line 82 "c:\\smartgravitybubblectrl\\smartbubble.h"
	coclass CSmartBubble {
		interface ISmartBubble;
	};

	[
		uuid(03F610DD-F71C-497B-938E-7DB25A411F2D),
		helpstring("_ISmartGravityBubble event interface")
	] 
#line 70 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	dispinterface _ISmartGravityBubbleEvents {
	properties:

	methods:
		[id(1),helpstring("method OnBubbleClicked")] HRESULT  OnBubbleClicked([in]LONG ID);
		[id(2),helpstring("method OnLeftButtonDown")] HRESULT  OnLeftButtonDown([in]LONG X, [in]LONG Y);
		[id(3),helpstring("method OnRightButtonDown")] HRESULT  OnRightButtonDown([in]LONG x, [in]LONG y);
	};

	[
		version(1.0),
		uuid(D49DA833-A6DB-4DB1-B30A-BD0FE1CB4750),
		helpstring("SmartGravityBubble Class")
	] 
#line 89 "c:\\smartgravitybubblectrl\\smartgravitybubble.h"
	coclass CSmartGravityBubble {
		interface ISmartGravityBubble;
		[default, source]	interface _ISmartGravityBubbleEvents;
	};

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions