VirtualBox

Changeset 32843 in vbox for trunk/include/VBox/com/ptr.h


Ignore:
Timestamp:
Sep 30, 2010 1:20:23 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66310
Message:

Main: Added an example on how to convert a ComObjPtr to an ComPtr of the same
type. I never remember that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/ptr.h

    r30681 r32843  
    406406 * The methods behave the same except that ComObjPtr has the additional createObject()
    407407 * method which allows for instantiating a new implementation object.
     408 *
     409 * Note: To convert a ComObjPtr<InterfaceImpl> to a ComObj<IInterface> you have
     410 * to query the interface. See the following example code for the IProgress
     411 * interface:
     412 *
     413 *  @code
     414 *
     415 *  {
     416 *      ComObjPtr<Progress> pProgress;          // create the server side object
     417 *      pProgress.createObject();               // ...
     418 *      pProgress->init(...);                   // ...
     419 *      ComPtr<IProgress> pProgress2;           // create an interface pointer
     420 *      pProgress.queryInterfaceTo(pProgress2); // transfer the interface
     421 *  }
     422 *
     423 *  @endcode
    408424 */
    409425template <class T>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette