[NEW C++] I_Unknown::QueryInterfaces() + macros

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jun 7 10:46:28 CDT 2006


Now we have full-featured QueryInterface() method, like in COM.


QueryInterface() this is analog of dynamic_cast<>()

Example:

 I_FldObjectPtr pObjectPtr = ...

 // now you want work with ObjectPtr as with Link.
 // old way - and it still works:

    I_Link_Ptr pLink = fbl_dynamic_cast<I_Link>( pObjectPtr );

 // new way

    I_Link_Ptr pLink = (I_Link*) pObjectPtr->QueryInterface( IID_I_Link );

 // or with help of macro:
   
    I_Link_Ptr pLink = QUERY_INTERFACE( pObjectPtr, I_Link );

 // or even more short macro:

    I_Link_Ptr pLink = QI( pObjectPtr, I_Link );



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list