Declaration problem
-
Hey, I have to define a user defined property but in the "IDL" file i am getting a compilation error i.e error MIDL2025 : syntax error : expecting a type specification near "ADO_ROWSET" at this line
[propget, id(6), helpstring("property FetchRowSet")] HRESULT FetchRowSet([out, retval] ADO_ROWSET *pVal);
Please help me in doing so as my whole of design of dll depends on this problem pls through some lightRegards, Pankaj Sachdeva
-
Hey, I have to define a user defined property but in the "IDL" file i am getting a compilation error i.e error MIDL2025 : syntax error : expecting a type specification near "ADO_ROWSET" at this line
[propget, id(6), helpstring("property FetchRowSet")] HRESULT FetchRowSet([out, retval] ADO_ROWSET *pVal);
Please help me in doing so as my whole of design of dll depends on this problem pls through some lightRegards, Pankaj Sachdeva
pan_angel wrote:
ADO_ROWSET
MIDL compiler is not recognizing
ADO_ROWSET
, isn't that declared before using ?
Prasad MS MVP - VC++
-
pan_angel wrote:
ADO_ROWSET
MIDL compiler is not recognizing
ADO_ROWSET
, isn't that declared before using ?
Prasad MS MVP - VC++
actually it is a seperate class and i want to use it's object as the argument, but it is not declared in IDL file before this statement. This is actuall IDL file that is created in default
// dbcs07.idl : IDL source for dbcs07.dll // // This file will be processed by the MIDL tool to // produce the type library (dbcs07.tlb) and marshalling code. import "oaidl.idl"; import "ocidl.idl"; typedef enum { connOracle = 1, connSQLServer = 2, connAccess = 3 } dbFlag; [ object, uuid(6DD75115-9828-4BA0-9006-D85B1DFDA2A8), dual, helpstring("IADO_DB Interface"), pointer_default(unique) ] interface IADO_DB : IDispatch { [id(1), helpstring("method ConnectDatabase")] HRESULT ConnectDatabase(BSTR sDatabase,BSTR sUserID,BSTR sPassword,BSTR sServer,dbFlag connDB); [id(2), helpstring("method DisconnectDatabase")] HRESULT DisconnectDatabase(); [id(3), helpstring("method ExecuteSQL")] HRESULT ExecuteSQL(BSTR sQuery); [propget, id(4), helpstring("property DatabaseName")] HRESULT DatabaseName([out, retval] BSTR *pVal); [propget, id(5), helpstring("property SQL")] HRESULT SQL([out, retval] BSTR *pVal); [propput, id(5), helpstring("property SQL")] HRESULT SQL([in] BSTR newVal); [propget, id(6), helpstring("property RowSet")] HRESULT RowSet([out, retval] ADO_ROWSET *pVal); }; [ object, uuid(DEAD417C-B1EA-401D-8F8B-55A2207BDB52), dual, helpstring("IADO_ROWSET Interface"), pointer_default(unique) ] interface IADO_ROWSET : IDispatch { }; [ uuid(440FC80A-7700-4291-B683-7B4B2BE7D9E2), version(1.0), helpstring("dbcs07 1.0 Type Library") ] library DBCS07Lib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid(2A6DE5C6-9BEC-49FE-8626-23D4C9656C93), helpstring("ADO_DB Class") ] coclass ADO_DB { [default] interface IADO_DB; }; [ uuid(74FCF560-93D9-4F15-B477-5A62E529C567), helpstring("ADO_ROWSET Class") ] coclass ADO_ROWSET { [default] interface IADO_ROWSET; }; };
if it has any problem pls let me know Thank youRegards, Pankaj Sachdeva
-
actually it is a seperate class and i want to use it's object as the argument, but it is not declared in IDL file before this statement. This is actuall IDL file that is created in default
// dbcs07.idl : IDL source for dbcs07.dll // // This file will be processed by the MIDL tool to // produce the type library (dbcs07.tlb) and marshalling code. import "oaidl.idl"; import "ocidl.idl"; typedef enum { connOracle = 1, connSQLServer = 2, connAccess = 3 } dbFlag; [ object, uuid(6DD75115-9828-4BA0-9006-D85B1DFDA2A8), dual, helpstring("IADO_DB Interface"), pointer_default(unique) ] interface IADO_DB : IDispatch { [id(1), helpstring("method ConnectDatabase")] HRESULT ConnectDatabase(BSTR sDatabase,BSTR sUserID,BSTR sPassword,BSTR sServer,dbFlag connDB); [id(2), helpstring("method DisconnectDatabase")] HRESULT DisconnectDatabase(); [id(3), helpstring("method ExecuteSQL")] HRESULT ExecuteSQL(BSTR sQuery); [propget, id(4), helpstring("property DatabaseName")] HRESULT DatabaseName([out, retval] BSTR *pVal); [propget, id(5), helpstring("property SQL")] HRESULT SQL([out, retval] BSTR *pVal); [propput, id(5), helpstring("property SQL")] HRESULT SQL([in] BSTR newVal); [propget, id(6), helpstring("property RowSet")] HRESULT RowSet([out, retval] ADO_ROWSET *pVal); }; [ object, uuid(DEAD417C-B1EA-401D-8F8B-55A2207BDB52), dual, helpstring("IADO_ROWSET Interface"), pointer_default(unique) ] interface IADO_ROWSET : IDispatch { }; [ uuid(440FC80A-7700-4291-B683-7B4B2BE7D9E2), version(1.0), helpstring("dbcs07 1.0 Type Library") ] library DBCS07Lib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid(2A6DE5C6-9BEC-49FE-8626-23D4C9656C93), helpstring("ADO_DB Class") ] coclass ADO_DB { [default] interface IADO_DB; }; [ uuid(74FCF560-93D9-4F15-B477-5A62E529C567), helpstring("ADO_ROWSET Class") ] coclass ADO_ROWSET { [default] interface IADO_ROWSET; }; };
if it has any problem pls let me know Thank youRegards, Pankaj Sachdeva
You could use
IADO_ROWSET
as argument, not it's coclass. And need to make forward declaration for interface , before using as parameter.
Prasad MS MVP - VC++
-
You could use
IADO_ROWSET
as argument, not it's coclass. And need to make forward declaration for interface , before using as parameter.
Prasad MS MVP - VC++
Thankx Mr. Prasad i got u it worked
Regards, Pankaj Sachdeva