Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_COMATTRIB attributes have no effect
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
_COMATTRIB attributes have no effect
Divers
Thread ID:
00685958
Message ID:
00685958
Vues:
90
Hi,

I've written a class that uses the _COMATTRIB array to configure type library attributes. Some of them seem to have no effect at all. Below is the class code, which is compiled into an MT COM DLL.

And here's what I would expect, but doesn't seem to work properly:
x = CREATEOBJECT("sample.sample")

*-- This shouldn't be possible, since the property is defined as read only
*-- Note: The Object Browser shows the correct information (read-only).
x.TimerInterval = 200      

*-- This shouldn't be possible, since the property is defined as read only.
*-- Additionally this doesn't give me an error, but IMO it should, since the
*-- property is numeric (TYPE("x.TimerInterval") returns "N").
x.TimerInterval = "kjhk"   
* _COMATTRIB type library attributes
#DEFINE COMATTRIB_RESTRICTED	0x1			&& Not accessible from macro languages. 
#DEFINE COMATTRIB_HIDDEN		0x40 		&& Not displayed to user.
#DEFINE COMATTRIB_NONBROWSABLE	0x400 		&& appears in object browser, but not in properties browser.
#DEFINE COMATTRIB_READONLY		0x100000	&& read-only (PropertyGet)
#DEFINE COMATTRIB_WRITEONLY		0x200000	&& write-only (PropertyPut)

DEFINE CLASS sample AS Session OLEPUBLIC

	TimerInterval = 0
	DIMENSION TimerInterval_COMATTRIB[5]
	TimerInterval_COMATTRIB[1] = COMATTRIB_READONLY
	TimerInterval_COMATTRIB[2] = ""
	TimerInterval_COMATTRIB[3] = "TimerInterval"
	TimerInterval_COMATTRIB[4] = "Long"
	TimerInterval_COMATTRIB[5] = 0

ENDDEFINE
Am I missing something fundamental here, or is it really not working correctly?

Thanks for any input,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform