convert idl to c# or tlb

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • VeNoM00

    convert idl to c# or tlb

    Hi,
    i need to use some classes defined inside urlmon.dll, i have its idl
    and c++ (.h file) definitions and i need to convert one of them to C#
    or to a type library (tlb). i also have urlmon.lib but i don't know if
    it could be useful. I tried to use midl.exe to convert idl to tlb but
    it dosen't creates any TLB file! just some c++ files like urlmon.h,
    urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everything is
    ok! What can i do?
    thanks in advance

  • Patrice

    #2
    Re: convert idl to c# or tlb

    This is just the default for the compiler. If you want a TLB file you'll
    need to use the appropriate command line option. Don't remember but from the
    doc I believe the /newtlb switch could be enought...

    You'll find the MIDL documentation at :


    If it works it could be likely quicker than converting the IDL file to C#
    (though the syntax have some similarity and is likely inspired from IDL).

    --
    Patrice

    "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
    1163004700.6139 20.156620@k70g2 00...legr oups.com...
    Hi,
    i need to use some classes defined inside urlmon.dll, i have its idl
    and c++ (.h file) definitions and i need to convert one of them to C#
    or to a type library (tlb). i also have urlmon.lib but i don't know if
    it could be useful. I tried to use midl.exe to convert idl to tlb but
    it dosen't creates any TLB file! just some c++ files like urlmon.h,
    urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everything is
    ok! What can i do?
    thanks in advance
    >

    Comment

    • VeNoM00

      #3
      Re: convert idl to c# or tlb

      no, /newtlb is the default:

      /newtlb Generate new format type libraries (default)

      i tried to specify it explitly but nothing...

      Patrice wrote:
      This is just the default for the compiler. If you want a TLB file you'll
      need to use the appropriate command line option. Don't remember but from the
      doc I believe the /newtlb switch could be enought...
      >
      You'll find the MIDL documentation at :

      >
      If it works it could be likely quicker than converting the IDL file to C#
      (though the syntax have some similarity and is likely inspired from IDL).
      >
      --
      Patrice
      >
      "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
      1163004700.6139 20.156620@k70g2 00...legr oups.com...
      Hi,
      i need to use some classes defined inside urlmon.dll, i have its idl
      and c++ (.h file) definitions and i need to convert one of them to C#
      or to a type library (tlb). i also have urlmon.lib but i don't know if
      it could be useful. I tried to use midl.exe to convert idl to tlb but
      it dosen't creates any TLB file! just some c++ files like urlmon.h,
      urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everything is
      ok! What can i do?
      thanks in advance

      Comment

      • Patrice

        #4
        Re: convert idl to c# or tlb

        Have you checked also that the IDL files contains a library statement ? I
        would try with a simple dummy file to make sure...

        Sorry for the poor help but it's been a while since I last used MIDL...

        --
        Patrice

        "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
        1163007729.3694 53.24690@k70g20 00...legro ups.com...
        no, /newtlb is the default:

        /newtlb Generate new format type libraries (default)

        i tried to specify it explitly but nothing...

        Patrice wrote:
        This is just the default for the compiler. If you want a TLB file you'll
        need to use the appropriate command line option. Don't remember but from
        the
        doc I believe the /newtlb switch could be enought...
        >
        You'll find the MIDL documentation at :

        >
        If it works it could be likely quicker than converting the IDL file to C#
        (though the syntax have some similarity and is likely inspired from IDL).
        >
        --
        Patrice
        >
        "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
        1163004700.6139 20.156620@k70g2 00...legr oups.com...
        Hi,
        i need to use some classes defined inside urlmon.dll, i have its idl
        and c++ (.h file) definitions and i need to convert one of them to C#
        or to a type library (tlb). i also have urlmon.lib but i don't know if
        it could be useful. I tried to use midl.exe to convert idl to tlb but
        it dosen't creates any TLB file! just some c++ files like urlmon.h,
        urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everything is
        ok! What can i do?
        thanks in advance

        Comment

        • VeNoM00

          #5
          Re: convert idl to c# or tlb

          what's a library statement? how can i add it? if you are interested the
          file is urlmon.idl
          here's a link to a copy of that file:


          Patrice wrote:
          Have you checked also that the IDL files contains a library statement ? I
          would try with a simple dummy file to make sure...
          >
          Sorry for the poor help but it's been a while since I last used MIDL...
          >
          --
          Patrice
          >
          "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
          1163007729.3694 53.24690@k70g20 00...legro ups.com...
          no, /newtlb is the default:
          >
          /newtlb Generate new format type libraries (default)
          >
          i tried to specify it explitly but nothing...
          >
          Patrice wrote:
          >
          This is just the default for the compiler. If you want a TLB file you'll
          need to use the appropriate command line option. Don't remember but from
          the
          doc I believe the /newtlb switch could be enought...

          You'll find the MIDL documentation at :


          If it works it could be likely quicker than converting the IDL file to C#
          (though the syntax have some similarity and is likely inspired from IDL).

          --
          Patrice

          "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
          1163004700.6139 20.156620@k70g2 00...legr oups.com...
          Hi,
          i need to use some classes defined inside urlmon.dll, i have its idl
          and c++ (.h file) definitions and i need to convert one of them to C#
          or to a type library (tlb). i also have urlmon.lib but i don't know if
          it could be useful. I tried to use midl.exe to convert idl to tlb but
          it dosen't creates any TLB file! just some c++ files like urlmon.h,
          urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everything is
          ok! What can i do?
          thanks in advance
          >

          Comment

          • Patrice

            #6
            Re: convert idl to c# or tlb

            This is the statement that defines a type library and it seems to be missing
            from this IDL file.

            Are you use you need a "class" from this file. If a STDAPI call, it could be
            simpler after all ;-) to use DllImport to declare the function you need.

            You may want also to explain what exactly you are trying to do in case
            someone would have an alternate simpler way of doing this than using URLMon.

            Good luck.

            --
            Patrice

            "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
            1163009344.6205 65.36340@m73g20 00...legro ups.com...
            what's a library statement? how can i add it? if you are interested the
            file is urlmon.idl
            here's a link to a copy of that file:


            Patrice wrote:
            Have you checked also that the IDL files contains a library statement ? I
            would try with a simple dummy file to make sure...
            >
            Sorry for the poor help but it's been a while since I last used MIDL...
            >
            --
            Patrice
            >
            "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
            1163007729.3694 53.24690@k70g20 00...legro ups.com...
            no, /newtlb is the default:
            >
            /newtlb Generate new format type libraries (default)
            >
            i tried to specify it explitly but nothing...
            >
            Patrice wrote:
            >
            This is just the default for the compiler. If you want a TLB file you'll
            need to use the appropriate command line option. Don't remember but from
            the
            doc I believe the /newtlb switch could be enought...

            You'll find the MIDL documentation at :


            If it works it could be likely quicker than converting the IDL file to
            C#
            (though the syntax have some similarity and is likely inspired from
            IDL).

            --
            Patrice

            "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
            1163004700.6139 20.156620@k70g2 00...legr oups.com...
            Hi,
            i need to use some classes defined inside urlmon.dll, i have its idl
            and c++ (.h file) definitions and i need to convert one of them to C#
            or to a type library (tlb). i also have urlmon.lib but i don't know if
            it could be useful. I tried to use midl.exe to convert idl to tlb but
            it dosen't creates any TLB file! just some c++ files like urlmon.h,
            urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everything is
            ok! What can i do?
            thanks in advance
            >

            Comment

            • VeNoM00

              #7
              Re: convert idl to c# or tlb

              i need to use the interface IInternteSessio n and many others... :/ i'm
              trying to create a mime filter for ie in c# (actually in vb.net but the
              language doesn't matter).

              So... you haven't an idea of why midl doesn't work properly?

              Patrice ha scritto:
              This is the statement that defines a type library and it seems to be missing
              from this IDL file.
              >
              Are you use you need a "class" from this file. If a STDAPI call, it couldbe
              simpler after all ;-) to use DllImport to declare the function you need.
              >
              You may want also to explain what exactly you are trying to do in case
              someone would have an alternate simpler way of doing this than using URLMon.
              >
              Good luck.
              >
              --
              Patrice
              >
              "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
              1163009344.6205 65.36340@m73g20 00...legro ups.com...
              what's a library statement? how can i add it? if you are interested the
              file is urlmon.idl
              here's a link to a copy of that file:

              >
              Patrice wrote:
              >
              Have you checked also that the IDL files contains a library statement ?I
              would try with a simple dummy file to make sure...

              Sorry for the poor help but it's been a while since I last used MIDL...

              --
              Patrice

              "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
              1163007729.3694 53.24690@k70g20 00...legro ups.com...
              no, /newtlb is the default:

              /newtlb Generate new format type libraries (default)

              i tried to specify it explitly but nothing...

              Patrice wrote:
              This is just the default for the compiler. If you want a TLB file you'll
              need to use the appropriate command line option. Don't remember but from
              the
              doc I believe the /newtlb switch could be enought...
              >
              You'll find the MIDL documentation at :

              >
              If it works it could be likely quicker than converting the IDL file to
              C#
              (though the syntax have some similarity and is likely inspired from
              IDL).
              >
              --
              Patrice
              >
              "VeNoM00" <venom.zero.zer o@gmail.coma écrit dans le message de news:
              1163004700.6139 20.156620@k70g2 00...legr oups.com...
              Hi,
              i need to use some classes defined inside urlmon.dll, i have its idl
              and c++ (.h file) definitions and i need to convert one of them to C#
              or to a type library (tlb). i also have urlmon.lib but i don't knowif
              it could be useful. I tried to use midl.exe to convert idl to tlb but
              it dosen't creates any TLB file! just some c++ files like urlmon.h,
              urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everythingis
              ok! What can i do?
              thanks in advance

              Comment

              • Mattias Sjögren

                #8
                Re: convert idl to c# or tlb

                >i need to use the interface IInternteSessio n and many others... :/ i'm
                >trying to create a mime filter for ie in c# (actually in vb.net but the
                >language doesn't matter).
                I wouldn't recommend doing that in managed code. The reason is the
                same as for shell extensions. The filter may be loaded into processes
                that don't expect managed code to run, or that may already have loaded
                an incompatible version of the CLR.




                Mattias

                --
                Mattias Sjögren [C# MVP] mattias @ mvps.org
                http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
                Please reply only to the newsgroup.

                Comment

                • VeNoM00

                  #9
                  Re: convert idl to c# or tlb

                  That's not a problem: i'm creating a browser. This mime filter will
                  affect just my process

                  Mattias Sjögren ha scritto:
                  i need to use the interface IInternteSessio n and many others... :/ i'm
                  trying to create a mime filter for ie in c# (actually in vb.net but the
                  language doesn't matter).
                  >
                  I wouldn't recommend doing that in managed code. The reason is the
                  same as for shell extensions. The filter may be loaded into processes
                  that don't expect managed code to run, or that may already have loaded
                  an incompatible version of the CLR.
                  >

                  >
                  >
                  Mattias
                  >
                  --
                  Mattias Sjögren [C# MVP] mattias @ mvps.org
                  http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
                  Please reply only to the newsgroup.

                  Comment

                  Working...