The scoop on hidden, restricted properties
Author |
Message |
Sam Carleto #1 / 5
|
 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 |
|
 |
Klaus H. Probs #2 / 5
|
 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 |
|
 |
Sam Carleto #3 / 5
|
 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 |
|
 |
Jens Neuhalfe #4 / 5
|
 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 |
|
 |
Klaus H. Probs #5 / 5
|
 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 |
|
|
|