How to show and fetch the displayed dimensions and tolerances in the part,assembly or drawing document

I am running SolidWorks 2018 x64 Education Edition under Windows 10. And I have already created a C++ SW COM Non-Attributed Add-in project in Visual Studio 2015 Professional successfully . I would like to use the "IGetSpecificAnnotation( )" to get the specific underlying object associated with this annotation. I had write source code nearly as follows:

         CComPtr pAnn;

         CComPtr pAnnDisplayDimension;

         CComPtr pUn;

               pUn->QueryInterface(IID_IDisplayDimension, reinterpret_cast(&pAnnDisplayDimension));

               pAnn->IGetSpecificAnnotation(&pUn);

I wonder how to show and fetch the displayed dimensions and tolerances in the part,assembly or drawing document. Any tips or reply would be greatly appreciated!

SolidworksApi/macros