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. ERROR: (COM) when compiling with MIDL...

ERROR: (COM) when compiling with MIDL...

Scheduled Pinned Locked Moved C / C++ / MFC
comhtmlsysadminhelp
3 Posts 3 Posters 8 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
    Lost User
    wrote on last edited by
    #1

    Hi All, I have a dll that works great in VB/ASP, but when I created an .idl file, I get an error when compiling: .\test.idl(31) : error MIDL2025 : syntax error : expecting a type specification near "<" .\test.idl(31) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation below is where it is happening: NOTE: On the following line, I had to put quotes in the code so you could see the code because it looked like a TAG in HTML...("<"GetRefTypeInfo failed">"**) HRESULT GetItem([in, out] VARIANT* Server, [in, out] VARIANT* Category, [in, out] VARIANT* CType, [out, retval] ("<"GetRefTypeInfo failed">"** ); The idl file was generated by OLE View (cut/paste) to test.idl and compiled with "C:>MIDL test.idl /h test.h" Can anyone tell me why this is giving this error :confused: Regards, Dan

    V 1 Reply Last reply
    0
    • L Lost User

      Hi All, I have a dll that works great in VB/ASP, but when I created an .idl file, I get an error when compiling: .\test.idl(31) : error MIDL2025 : syntax error : expecting a type specification near "<" .\test.idl(31) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation below is where it is happening: NOTE: On the following line, I had to put quotes in the code so you could see the code because it looked like a TAG in HTML...("<"GetRefTypeInfo failed">"**) HRESULT GetItem([in, out] VARIANT* Server, [in, out] VARIANT* Category, [in, out] VARIANT* CType, [out, retval] ("<"GetRefTypeInfo failed">"** ); The idl file was generated by OLE View (cut/paste) to test.idl and compiled with "C:>MIDL test.idl /h test.h" Can anyone tell me why this is giving this error :confused: Regards, Dan

      V Offline
      V Offline
      Vivek Rajan
      wrote on last edited by
      #2

      ****HRESULT GetItem([in, out] VARIANT* Server, [in, out] VARIANT* Category, [in, out] VARIANT* CType, [out, retval] ("<"GetRefTypeInfo failed">"** ); It looks like OLE View was not successful. <GetRefTypeInfo failed> is invalid in IDL. What is the type of the returned parameter ? You can manually fix it in the IDL file & then retry. V

      D 1 Reply Last reply
      0
      • V Vivek Rajan

        ****HRESULT GetItem([in, out] VARIANT* Server, [in, out] VARIANT* Category, [in, out] VARIANT* CType, [out, retval] ("<"GetRefTypeInfo failed">"** ); It looks like OLE View was not successful. <GetRefTypeInfo failed> is invalid in IDL. What is the type of the returned parameter ? You can manually fix it in the IDL file & then retry. V

        D Offline
        D Offline
        Dan Madden
        wrote on last edited by
        #3

        Hi Vivek, thanks for the reply! Ok, if this is because of failure, then I will set the value in the IDL myself. It should be an "ADO Recordset" it is returning...It compiled ok now...I added the below to the IDL: importlib("C:\Program Files\Common Files\System\ADO\MSADO15.DLL"); HRESULT SearchTickets( [in, out] VARIANT* rsGotSchema, [in, out] VARIANT* Criteria, [in, out] VARIANT* ServerName, [out, retval] _Recordset **ptrRs ); Ok done and I get it compiled, but when ran it errors here (see below): // param #1: a passed recordset (checked before OK...) // param #2: Query for the new recordset // param #3: Server name // param #4: the recorset to be filled _RecordsetPtr pRsTickets; hr = pRsTickets.CreateInstance(__uuidof (Recordset)); if(SUCCEEDED(hr)) { hr = IQUIZ->SearchTickets( (VARIANT*)&pRsSchema, COleVariant("Some query..."), COleVariant("Server..."), (_Recordset**) &pRsTickets); // ***************************************************** // When here, both recordsets have been set to NULL???? // ***************************************************** } Output from DOS... BEFORE CreateInstance()...pRsTickets: 0 AFTER CreateInstance()...pRsTickets: 1 BEFORE SearchTickets()...pRsSchema: 1 SearchTickets Failed (hr): -2146827864 AFTER SearchTickets()...pRsTickets: 0 AFTER SearchTickets()...pRsSchema: 0 Release OK... This is where it blows-up (C:\...VC98\include\COMIP.H): // Returns the address of the interface pointer contained in this // class. This is useful when using the COM/OLE interfaces to create // this interface. // Interface** operator&() throw() { _Release(); m_pInterface = NULL; return &m_pInterface; } Can you (or anyone) help???? Regards, Dan

        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