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. COM
  4. type mismatch

type mismatch

Scheduled Pinned Locked Moved COM
comquestion
2 Posts 2 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.
  • L Offline
    L Offline
    Lily18
    wrote on last edited by
    #1

    I have a method in a activeX dll ( created in VB) My program is in VC6: I used #import to link with the DLL. virtual HRESULT __stdcall TimeZone ( BSTR mstrPlant, long mlngTime, long * mlngTimeDifference, enum ConneBD enmConneBD, struct _clsErr * * _arg5 ) = 0; It is declared like that in .tlh I call it this way: time_t *ltime; long * timeDiff; ltime = new time_t(); timeDiff = new long(); *ltime = 0; *timeDiff = 0; time( ltime ); struct _clsErr *m_E; hresult = m_t->TimeZone(OLESTR"01"),*ltime,timeDiff,BD_OR,&m_E); hresult tells me that every thing worked fine but timeDiff return empty. I get "type dismatch" from the struc _clsErr.. My parameter's types seem ok.. Can somebody see what I'm doing wrong? thanks, Lily

    A 1 Reply Last reply
    0
    • L Lily18

      I have a method in a activeX dll ( created in VB) My program is in VC6: I used #import to link with the DLL. virtual HRESULT __stdcall TimeZone ( BSTR mstrPlant, long mlngTime, long * mlngTimeDifference, enum ConneBD enmConneBD, struct _clsErr * * _arg5 ) = 0; It is declared like that in .tlh I call it this way: time_t *ltime; long * timeDiff; ltime = new time_t(); timeDiff = new long(); *ltime = 0; *timeDiff = 0; time( ltime ); struct _clsErr *m_E; hresult = m_t->TimeZone(OLESTR"01"),*ltime,timeDiff,BD_OR,&m_E); hresult tells me that every thing worked fine but timeDiff return empty. I get "type dismatch" from the struc _clsErr.. My parameter's types seem ok.. Can somebody see what I'm doing wrong? thanks, Lily

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      time_t is not automation compatible, I think. try a DATE or a VARIANT(VT_DATE) instead of time_t.

      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