如何获得CComBSTR对象的指针?

解决方案 »

  1.   

    为什么用 pText =_com_util::ConvertBSTRToString(m_sText); 
    提示 _com_util不上namesapce/class ? 然后说ConvertBSTRToString()没有定义?
      

  2.   

    ok 上面那个问题少个头文件 解决了!

    还有就是 
    IFont *pIFont; 如何从pIFont得到字体的高度? 大家帮帮忙!
      

  3.   

    使用前需要加上comutil.h和comsupp.lib
      

  4.   

    IFont::get_hFont Declared in ocidl.h.HRESULT get_hFont(
      HFONT* phfont  //Pointer to the font handle
    );
    在HFONT里面找找
      

  5.   

    我开始是这样做的:
    CY *pSize = NULL;
    pIFont->get_Size (pSize);
    WORD wFontHeight = (WORD)((*pSize)>>32);
    但是不对啊~~
    帮帮忙~~
      

  6.   

    但是我用CFont有说没有定义~~~
    包含<afxwin.h>又说已经有了这个头文件 ? 怎么办的?
      

  7.   

    我包含afxwin.h 却出现这个错误
    f:\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>
    Error executing cl.exe.
      

  8.   

    我要用CRect类,然后包含了afxwin.h后也出现一样的错误,包含windef.h后还是说没有定义,哪位帮一下忙呢?谢谢