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. Declaration problem

Declaration problem

Scheduled Pinned Locked Moved COM
helpdesign
5 Posts 2 Posters 1 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.
  • K Offline
    K Offline
    Karismatic
    wrote on last edited by
    #1

    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 light

    Regards, Pankaj Sachdeva

    P 1 Reply Last reply
    0
    • K Karismatic

      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 light

      Regards, Pankaj Sachdeva

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      pan_angel wrote:

      ADO_ROWSET

      MIDL compiler is not recognizing ADO_ROWSET, isn't that declared before using ?


      Prasad MS MVP -  VC++

      K 1 Reply Last reply
      0
      • P prasad_som

        pan_angel wrote:

        ADO_ROWSET

        MIDL compiler is not recognizing ADO_ROWSET, isn't that declared before using ?


        Prasad MS MVP -  VC++

        K Offline
        K Offline
        Karismatic
        wrote on last edited by
        #3

        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 you

        Regards, Pankaj Sachdeva

        P 1 Reply Last reply
        0
        • K Karismatic

          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 you

          Regards, Pankaj Sachdeva

          P Offline
          P Offline
          prasad_som
          wrote on last edited by
          #4

          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++

          K 1 Reply Last reply
          0
          • P prasad_som

            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++

            K Offline
            K Offline
            Karismatic
            wrote on last edited by
            #5

            Thankx Mr. Prasad i got u it worked

            Regards, Pankaj Sachdeva

            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