Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Compiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help.

Compiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help.

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helpcom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arris74
    wrote on last edited by
    #1

    Hello dear ATL experts, While trying to compile a VC++ 6.0 project with VC++ 7.1, I have got the following error : d:\TESTINGONLY\dbstudio\DSIFormat.h(58) : error C2664: '_com_ptr_t<_IIID>::_com_ptr_t(int)' : cannot convert parameter 1 from 'ATL::CComPtr<T>' to 'int' with [ _IIID=_com_IIID<StdFormat::IStdDataFormatDisp,& _GUID_6c51b910_900b_11d0_9484_00a0c91110ed> ] and [ T=StdFormat::IStdDataFormatDisp ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called This error is caused by the following instanciation CComPtrStdFormat::IStdDataFormatDisp m_fmtBinary; StdFormat::IStdDataFormatDisp is located in a .tlh file. I am a newbee with COM and I guess it is an interface generated by the compiler. Here is its definition struct __declspec(uuid("6c51b910-900b-11d0-9484-00a0c91110ed")) IStdDataFormatDisp : IDataFormatDisp { // // Property data // __declspec(property(get=GetType,put=PutType)) enum FormatType Type; __declspec(property(get=GetFormat,put=PutFormat)) _bstr_t Format; } It derives from struct __declspec(uuid("e675f3f0-91b5-11d0-9484-00a0c91110ed")) IDataFormatDisp : IDispatch {}; IDataFormatDisp does nothing so I wonder why not deriving IStdDataFormatDisp direcly from IDispatch Indeed the project works fine with visual c++ 6.0. I thank you very much for your help.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups