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. C / C++ / MFC
  4. OLE

OLE

Scheduled Pinned Locked Moved C / C++ / MFC
helpcom
4 Posts 4 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
    Aizaz
    wrote on last edited by
    #1

    i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz

    M D M 3 Replies Last reply
    0
    • A Aizaz

      i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz

      M Offline
      M Offline
      Maxwell Chen
      wrote on last edited by
      #2

      Aizaz wrote: OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic)); You only fed it 6 arguments for that function. No wonder~~~ :-D


      Maxwell Chen

      1 Reply Last reply
      0
      • A Aizaz

        i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz

        D Offline
        D Offline
        Diddy
        wrote on last edited by
        #3

        Its defined as : STDAPI OleLoadPicturePath{ LPOLESTR szURLorPath, LPUNKNOWN punkCaller, DWORD dwReserved, OLE_COLOR clrReserved, REFIID riid, LPVOID *ppvRet } So parm 5 is of type REFIDD - in C that expands to IID* or in C++ it expands to IID&. Your passing &IID_IPicture - IE IID*. Change it to: OleLoadPicturePath(OlePathName,NULL,0,0,IID_IPicture,(void *)(&Ipic)); On a side note, 6 is also wrong. Its of type LPVOID* - or void**. So persuming your IPic is IUnknown* (or whatever) you pass (void**)&Ipic - so in total OleLoadPicturePath(OlePathName, NULL, 0, 0, IID_IPicture,(void**)&Ipic);

        1 Reply Last reply
        0
        • A Aizaz

          i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz

          M Offline
          M Offline
          Member 421025
          wrote on last edited by
          #4

          It should be IID_IPicture and not &IID_IPicture

          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