在进行OLE开发的时候出现了一个小问题OleStdSwitchDisplayAspect的定义是在vc6.0上面的
具体位置:C:\Program Files (x86)\Microsoft Visual Studio\VC98\Include
下面是这个.h文件的描述
/*************************************************************************
**
**    OLE 2.0 Utilities
**
**    olestd.h
**
**    This file contains file contains data structure defintions,
**    function prototypes, constants, etc. for the common OLE 2.0
**    utilities.
**
**    These utilities include the following:
**          Debuging Assert/Verify macros
**          HIMETRIC conversion routines
**          reference counting debug support
**          OleStd API's for common compound-document app support
**
**    (c) Copyright Microsoft Corp. 1990 - 1996 All Rights Reserved
**
*************************************************************************/但是我目前需要用vs2012进行开发,搜索了一圈,没有发现这个olestd.h在vs2012以上的替代品。。也许接下来还会遇到很多问题,想问问大家,这个olestd.h(估计是vc6以前的产物)的替代品在vs2012应该是什么?或者我应该引入什么.h/.lib才能使用诸如olestd.h里面定义的OleStdSwitchDisplayAspect函数?

解决方案 »

  1.   

    好多函数都已经改变了。。
    整了一个下午还有几个没有找到定义。。我晕啊晕啊晕1>DOCUMENT.obj : error LNK2019: 无法解析的外部符号 _OleUIMetafilePictIconFree@4,该符号在函数 "public: virtual int __thiscall CPatronDoc::FInsertObject(struct HWND__ *)" (?FInsertObject@CPatronDoc@@UAEHPAUHWND__@@@Z) 中被引用
    1>IDROPTGT.obj : error LNK2019: 无法解析的外部符号 _XformSizeInHimetricToPixels@12,该符号在函数 "public: virtual long __stdcall CDropTarget::DragEnter(struct IDataObject *,unsigned long,struct _POINTL,unsigned long *)" (?DragEnter@CDropTarget@@UAGJPAUIDataObject@@KU_POINTL@@PAK@Z) 中被引用
    1>TENANT.obj : error LNK2019: 无法解析的外部符号 _XformRectInPixelsToHimetric@12,该符号在函数 "public: int __thiscall CTenant::Activate(unsigned long)" (?Activate@CTenant@@QAEHK@Z) 中被引用
    1>TENANT.obj : error LNK2019: 无法解析的外部符号 _XformSizeInPixelsToHimetric@12,该符号在函数 "public: void __thiscall CTenant::CopyEmbeddedObject(struct IDataObject *,struct tagFORMATETC *,struct _POINTL *)" (?CopyEmbeddedObject@CTenant@@QAEXPAUIDataObject@@PAUtagFORMATETC@@PAU_POINTL@@@Z) 中被引用
    1>TENANT.obj : error LNK2019: 无法解析的外部符号 _OleStdGetObjectDescriptorDataFromOleObject@24,该符号在函数 "public: void __thiscall CTenant::CopyEmbeddedObject(struct IDataObject *,struct tagFORMATETC *,struct _POINTL *)" (?CopyEmbeddedObject@CTenant@@QAEXPAUIDataObject@@PAUtagFORMATETC@@PAU_POINTL@@@Z) 中被引用
    1>TENANT.obj : error LNK2019: 无法解析的外部符号 _OleUIDrawHandles@20,该符号在函数 "public: void __thiscall CTenant::Draw(struct HDC__ *,struct tagDVTARGETDEVICE *,struct HDC__ *,int,int,int,int)" (?Draw@CTenant@@QAEXPAUHDC__@@PAUtagDVTARGETDEVICE@@0HHHH@Z) 中被引用
    1>TENANT.obj : error LNK2019: 无法解析的外部符号 _OleUIDrawShading@16,该符号在函数 "public: void __thiscall CTenant::Draw(struct HDC__ *,struct tagDVTARGETDEVICE *,struct HDC__ *,int,int,int,int)" (?Draw@CTenant@@QAEXPAUHDC__@@PAUtagDVTARGETDEVICE@@0HHHH@Z) 中被引用
    1>C:\Users\lenovo\Documents\Visual Studio 2012\Projects\bttncur\Debug\patron.exe : fatal error LNK1120: 7 个无法解析的外部命令
    ========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========还有7 个无法解析的外部命令,求各位大牛。。
      

  2.   

    Inside OLE 2 Code CHAP09的code能编译成功也能够运行起来。。不过结果不对啊。。什么情况。。而且com的部分在vs2012支持不是太好啊。。