The scoop on hidden, restricted properties 
Author Message
 The scoop on hidden, restricted properties

Ok, I understand both the hidden and the restricted attributes one
can put on a property, for the most part.  Look at this sample IDL:

   [propput, id(18)]
        HRESULT aProperty([in] IDispatch* newVal);
   [propget, id(18), hidden, restricted]
        HRESULT aProperty([out,retval] IDispatch* *pVal);

Now I would not expect to be able to get this property, but setting
it should not be a problem.  Low and behold, setting it throughs up
this compile error in VB:

-:> Function or interface marked as restricted, or the function uses
-:> an Automation type not supported in Visual Basic

What is going on here?

Sam



Sun, 20 Nov 2005 05:16:33 GMT  
 The scoop on hidden, restricted properties

The propput prototype is wrong as far as VB sees typelibs. It may be
callable from C++, but VB can't handle that IDispatch* thing. It has to be
IDispatch**.

--
____________________
Klaus H. Probst, MVP
   http://www.vbbox.com/

Please post/reply to the newsgroup(s)


Quote:
> Ok, I understand both the hidden and the restricted attributes one
> can put on a property, for the most part.  Look at this sample IDL:

>    [propput, id(18)]
>         HRESULT aProperty([in] IDispatch* newVal);
>    [propget, id(18), hidden, restricted]
>         HRESULT aProperty([out,retval] IDispatch* *pVal);

> Now I would not expect to be able to get this property, but setting
> it should not be a problem.  Low and behold, setting it throughs up
> this compile error in VB:

> -:> Function or interface marked as restricted, or the function uses
> -:> an Automation type not supported in Visual Basic

> What is going on here?

> Sam



Sun, 20 Nov 2005 14:45:19 GMT  
 The scoop on hidden, restricted properties

Quote:

> The propput prototype is wrong as far as VB sees typelibs. It may
> be callable from C++, but VB can't handle that IDispatch* thing.
> It has to be IDispatch**.

I beg to differ with you on this one.  I removed the hidden and
restricted attributes from the IDL and all works well.  On a
propget, it has to be a pointer to a pointer of an interface. But on
a propput, it should be only a pointer.

The quetion remains, why are the attributes on the propget affecting
the propput?

Quote:


> > Ok, I understand both the hidden and the restricted attributes one
> > can put on a property, for the most part.  Look at this sample
> > IDL:

> >    [propput, id(18)]
> >               HRESULT aProperty([in] IDispatch* newVal);
> >    [propget, id(18), hidden, restricted]
> >               HRESULT aProperty([out,retval] IDispatch* *pVal);

> > Now I would not expect to be able to get this property, but
> > setting it should not be a problem.  Low and behold, setting it
> > throughs up this compile error in VB:

> > -:> Function or interface marked as restricted, or the function
> > -:> uses an Automation type not supported in Visual Basic

> > What is going on here?



Sun, 20 Nov 2005 21:20:36 GMT  
 The scoop on hidden, restricted properties
Hi Sam,

I can only guess put I think it is the id - vb sees them as a unit (and
it is not wrong with that) - try two different Ids (and maybe you need
different names too).

Jens

Quote:

> Ok, I understand both the hidden and the restricted attributes one
> can put on a property, for the most part.  Look at this sample IDL:

>    [propput, id(18)]
>         HRESULT aProperty([in] IDispatch* newVal);
>    [propget, id(18), hidden, restricted]
>         HRESULT aProperty([out,retval] IDispatch* *pVal);

> Now I would not expect to be able to get this property, but setting
> it should not be a problem.  Low and behold, setting it throughs up
> this compile error in VB:

> -:> Function or interface marked as restricted, or the function uses
> -:> an Automation type not supported in Visual Basic

> What is going on here?

> Sam



Mon, 21 Nov 2005 19:59:50 GMT  
 The scoop on hidden, restricted properties


Quote:
> > The propput prototype is wrong as far as VB sees typelibs. It may
> > be callable from C++, but VB can't handle that IDispatch* thing.
> > It has to be IDispatch**.

> I beg to differ with you on this one.  I removed the hidden and
> restricted attributes from the IDL and all works well.  On a
> propget, it has to be a pointer to a pointer of an interface. But on
> a propput, it should be only a pointer.

> The quetion remains, why are the attributes on the propget affecting
> the propput?

I gree with the other reply in that VB might be seeing them as a unit,
although that would seem unlikely. Perhaps VB is expecting a propputref
instead?

--
____________________
Klaus H. Probst, MVP
   http://www.vbbox.com/

Please post/reply to the newsgroup(s)



Tue, 22 Nov 2005 14:18:41 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to hide properties in the property window

2. How to use Restrict or Find with second-level properties

3. Translated Properties - Find, Restrict, and Sort

4. Data Control: Recordsource-Property restricted to 255 Characters ??

5. HOWTO: Restrict access to public properties (or at least its data)

6. VB Screen Savers. The Real Scoop

7. VB4a Whats the scoop?

8. VB4>>Latest Scoop

9. QueryDef.Type property: "Hidden" queries

10. Edit the hidden property for Access objects

11. Change the hidden property for Access objects

12. How to hide a user property?

 

 
Powered by phpBB® Forum Software