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