[Qt-interest] Build Error with Q_PROPERTY() READ method ; How to invoke a Q_PROPERTY's READ only method

Santhosh Y santhosh at softjin.com
Wed Jul 28 09:59:18 CEST 2010


Hi,

Please see the following class, from which I am trying to define a 
Q_PROPERTY,  method which is a READ method.
///////////// Issue 1 ///////////////////
class NewGUICOMObj : public QObject
{
     Q_OBJECT

         Q_PROPERTY(bool RenewIACallBack  READ RenewIACallBack)

     public:
             ............................
}
*1>midl\oleaut32.dll : error MIDL2020 : error generating type library : 
SetFuncAndParamNames failed : RenewIACallBack (0x8002802C)*



/////////////The above issue will go,  If I do the following  
///////////////////

class NewGUICOMObj : public QObject
{
     Q_OBJECT

         Q_PROPERTY(bool renew  READ RenewIACallBack)

     public:
             ............................
}

But with this change I am not able to make use of this READ property, 
which I explained in the below Issue 2.

///////////// Issue 2 ///////////////////
This code, is to invoke COM object and call an interface which is 
defined using Q_PROPERTY.

    HRESULT hres = 
CoCreateInstance(QUuid("{084EF014-6C9B-4d50-8756-263CDAC6DE4B}"), // 
NewGUICOMObj Class ID ==>CLSID
                 0, CLSCTX_SERVER, IID_IUnknown, (LPVOID*)&ptr);

         if (hres == S_OK && ptr !=NULL ) { //success

              //Creating a QAxObject that wraps the COM object 
referenced by IUnknown.
             QAxObject* comObj= new QAxObject (ptr);

*            comObj->property("RenewIACallBack");* //Why would this 
fail?, Is it not the correct way of invoking READ only type Q_PROPERTY 
on QObject.
     } else { //failure
     }


Thanks in advance, if some body helps in this regard.
I am struck and dont know how to solve this!

-- 
----------------------------------------------------
Y Santhosh Kumar -
Senior Software Engineer,
SoftJin Technologies Pvt Ltd,
www.softjin.com
----------------------------------------------------



Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended solely
for  the use  of the  individual or entity  to which they  are  addressed. It
may  contain confidential,  proprietary or legally  privileged  information.
If  you  are  not  the  intended recipient please be advised that you have
received  this  message in error and any use is strictly prohibited. Please
immediately  delete it  and all copies of it from your system, destroy any
hard  copies  of  it and  notify  the  sender  by return mail. You must not,
directly or indirectly, use,  disclose,  distribute, print, or copy any part of
this message if you are not the intended recipient.
___________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100728/abef4f4e/attachment.html 


More information about the Qt-interest-old mailing list