[COM] How to use the .idl ?

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

    [COM] How to use the .idl ?

    Hi,

    I need to implement the IDownloadManage r interface. I found the files
    DownloadMgr.h and DownloadMgr.idl that define this interface, but I dont
    know what to do know ;-)
    I saw somewhere that I need to use the midl tool... so,

    C:\Temp\Include >midl downloadmgr.idl
    'midl' n'est pas reconnu en tant que commande interne
    ou externe, un programme exécutable ou un fichier de commandes.

    (I try a translation : 'midl' is not reconized as an internal or external
    command, an executable program or a command file)
    It might be a problem with the path variable. But even when I add the midl
    path by myself (I dont know why I should do that indeed), it doesnt work :

    C:\Temp\Include >midl downloadmgr.idl
    Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0361
    Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
    Processing .\downloadmgr.i dl
    midl : command line error MIDL1005 : cannot find C preprocessor cl.exe


    What must I do to get the compiled version of DownloadMgr.idl ? (or where
    can I find it on the web ?)

    Thanks

    --
    Vincent


  • Greg Ewing [MVP]

    #2
    Re: [COM] How to use the .idl ?

    Vincent, a couple of things from your post. First of all, did you install
    C++ with VS.Net? If you did, do you have a VS.Net Command Prompt link in
    Start|Programs| Microsoft Visual Studio...|Visua l Studio .Net Tools|? If you
    do use that and then run midl. That command prompt has all of the paths set
    up for you already.

    Second, Looks like you've been working on this for a while from all of the
    newsgroup posts you've put out there. I take it you have read the
    "Implementi ng a Custom Download Manager" on MSDN?

    Let us know how the midl/tlb creation goes once you use the .Net command
    prompt.

    --
    Greg Ewing [MVP]




    "Vincent Lascaux" <nospam@nospam. org> wrote in message
    news:3f83e584$0 $13279$626a54ce @news.free.fr.. .[color=blue]
    > Hi,
    >
    > I need to implement the IDownloadManage r interface. I found the files
    > DownloadMgr.h and DownloadMgr.idl that define this interface, but I dont
    > know what to do know ;-)
    > I saw somewhere that I need to use the midl tool... so,
    >
    > C:\Temp\Include >midl downloadmgr.idl
    > 'midl' n'est pas reconnu en tant que commande interne
    > ou externe, un programme exécutable ou un fichier de commandes.
    >
    > (I try a translation : 'midl' is not reconized as an internal or external
    > command, an executable program or a command file)
    > It might be a problem with the path variable. But even when I add the midl
    > path by myself (I dont know why I should do that indeed), it doesnt work :
    >
    > C:\Temp\Include >midl downloadmgr.idl
    > Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0361
    > Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
    > Processing .\downloadmgr.i dl
    > midl : command line error MIDL1005 : cannot find C preprocessor cl.exe
    >
    >
    > What must I do to get the compiled version of DownloadMgr.idl ? (or where
    > can I find it on the web ?)
    >
    > Thanks
    >
    > --
    > Vincent
    >
    >[/color]


    Comment

    • Vincent Lascaux

      #3
      Re: [COM] How to use the .idl ?

      > Vincent, a couple of things from your post. First of all, did you install[color=blue]
      > C++ with VS.Net? If you did, do you have a VS.Net Command Prompt link in
      > Start|Programs| Microsoft Visual Studio...|Visua l Studio .Net Tools|? If[/color]
      you[color=blue]
      > do use that and then run midl. That command prompt has all of the paths[/color]
      set[color=blue]
      > up for you already.[/color]

      Great, it nearly works now... I got the same problem as
      http://minilien.com/?pSUp7xEQ3s : no tlb file is created...
      To files (downloadmgr_i. c and downloadmgr_p.c ) were generated by midl...
      [color=blue]
      > Second, Looks like you've been working on this for a while from all of the
      > newsgroup posts you've put out there. I take it you have read the
      > "Implementi ng a Custom Download Manager" on MSDN?[/color]

      Yes, I read it... It looks pretty simple in fact (once you've setted it up).
      I still wonder what will be the C# equivalents of the HRESULT, IMoniker...
      types used as function parameters...

      Thanks
      --
      Vincent


      Comment

      • Nicholas Paldino [.NET/C# MVP]

        #4
        Re: [COM] How to use the .idl ?

        Vincent,

        You will not have to worry about the HRESULT, as that will be used by
        the runtime to throw exception information should an error occur. For the
        IMoniker type, it is already defined in the framework. Look in the
        System.Runtime. InteropServices namespace, and the UCOMIMoniker interface
        will give you what you need.

        Hope this helps.


        --
        - Nicholas Paldino [.NET/C# MVP]
        - nick(dot)paldin o=at=exisconsul ting<dot>com

        "Vincent Lascaux" <nospam@nospam. org> wrote in message
        news:3f840e0c$0 $13291$626a54ce @news.free.fr.. .[color=blue][color=green]
        > > Vincent, a couple of things from your post. First of all, did you[/color][/color]
        install[color=blue][color=green]
        > > C++ with VS.Net? If you did, do you have a VS.Net Command Prompt link[/color][/color]
        in[color=blue][color=green]
        > > Start|Programs| Microsoft Visual Studio...|Visua l Studio .Net Tools|? If[/color]
        > you[color=green]
        > > do use that and then run midl. That command prompt has all of the paths[/color]
        > set[color=green]
        > > up for you already.[/color]
        >
        > Great, it nearly works now... I got the same problem as
        > http://minilien.com/?pSUp7xEQ3s : no tlb file is created...
        > To files (downloadmgr_i. c and downloadmgr_p.c ) were generated by midl...
        >[color=green]
        > > Second, Looks like you've been working on this for a while from all of[/color][/color]
        the[color=blue][color=green]
        > > newsgroup posts you've put out there. I take it you have read the
        > > "Implementi ng a Custom Download Manager" on MSDN?[/color]
        >
        > Yes, I read it... It looks pretty simple in fact (once you've setted it[/color]
        up).[color=blue]
        > I still wonder what will be the C# equivalents of the HRESULT, IMoniker...
        > types used as function parameters...
        >
        > Thanks
        > --
        > Vincent
        >
        >[/color]


        Comment

        • Greg Ewing [MVP]

          #5
          Re: [COM] How to use the .idl ?

          Vincent, what are you putting at the command line? I can use

          midl downloadmgr.idl /tlb downloadmgr.tlb

          and it works great. Are you missing the tlb switch? Try midl /? for more
          info on command line options.

          --
          Greg Ewing [MVP]



          "Vincent Lascaux" <nospam@nospam. org> wrote in message
          news:3f840e0c$0 $13291$626a54ce @news.free.fr.. .[color=blue][color=green]
          > > Vincent, a couple of things from your post. First of all, did you[/color][/color]
          install[color=blue][color=green]
          > > C++ with VS.Net? If you did, do you have a VS.Net Command Prompt link[/color][/color]
          in[color=blue][color=green]
          > > Start|Programs| Microsoft Visual Studio...|Visua l Studio .Net Tools|? If[/color]
          > you[color=green]
          > > do use that and then run midl. That command prompt has all of the paths[/color]
          > set[color=green]
          > > up for you already.[/color]
          >
          > Great, it nearly works now... I got the same problem as
          > http://minilien.com/?pSUp7xEQ3s : no tlb file is created...
          > To files (downloadmgr_i. c and downloadmgr_p.c ) were generated by midl...
          >[color=green]
          > > Second, Looks like you've been working on this for a while from all of[/color][/color]
          the[color=blue][color=green]
          > > newsgroup posts you've put out there. I take it you have read the
          > > "Implementi ng a Custom Download Manager" on MSDN?[/color]
          >
          > Yes, I read it... It looks pretty simple in fact (once you've setted it[/color]
          up).[color=blue]
          > I still wonder what will be the C# equivalents of the HRESULT, IMoniker...
          > types used as function parameters...
          >
          > Thanks
          > --
          > Vincent
          >
          >[/color]


          Comment

          • Vincent Lascaux

            #6
            Re: [COM] How to use the .idl ?


            "Greg Ewing [MVP]" <gewing@_NO_SPA M_claritycon.co m> a écrit dans le message
            de news:OxhPMYbjDH A.3312@tk2msftn gp13.phx.gbl...[color=blue]
            > Vincent, what are you putting at the command line? I can use
            >
            > midl downloadmgr.idl /tlb downloadmgr.tlb
            >
            > and it works great. Are you missing the tlb switch? Try midl /? for more
            > info on command line options.[/color]

            Here is what I did. I had no tlb file generated...

            C:\Temp\Include >midl downloadmgr.idl /h downloadmgr.h /tlb downloadmgr.tlb
            Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0361
            Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
            Processing .\downloadmgr.i dl
            downloadmgr.idl
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\u nknwn.idl
            unknwn.idl
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\w types.idl
            wtypes.idl
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\b asetsd.h
            basetsd.h
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\g uiddef.h
            guiddef.h
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o cidl.idl
            ocidl.idl
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o leidl.idl
            oleidl.idl
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o bjidl.idl
            objidl.idl
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o aidl.idl
            oaidl.idl
            Processing .\servprov.idl
            servprov.idl
            Processing .\urlmon.idl
            urlmon.idl
            Processing .\msxml.idl
            msxml.idl
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o aidl.acf
            oaidl.acf
            Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o cidl.acf
            ocidl.acf
            64 bit Processing .\downloadmgr.i dl
            downloadmgr.idl
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\u nknwn.idl
            unknwn.idl
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\w types.idl
            wtypes.idl
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\b asetsd.h
            basetsd.h
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\g uiddef.h
            guiddef.h
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o cidl.idl
            ocidl.idl
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o leidl.idl
            oleidl.idl
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o bjidl.idl
            objidl.idl
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o aidl.idl
            oaidl.idl
            64 bit Processing .\servprov.idl
            servprov.idl
            64 bit Processing .\urlmon.idl
            urlmon.idl
            64 bit Processing .\msxml.idl
            msxml.idl
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o aidl.acf
            oaidl.acf
            64 bit Processing C:\Program Files\Microsoft Visual Studio .NET
            2003\VC7\Platfo rmSDK\include\o cidl.acf
            ocidl.acf

            C:\Temp\Include >dir download*
            Le volume dans le lecteur C n'a pas de nom.
            Le numéro de série du volume est BC0C-7D55

            Répertoire de C:\Temp\Include

            08/10/2003 18:30 6 191 downloadmgr.h
            02/11/2001 12:19 2 763 downloadmgr.idl
            08/10/2003 18:30 3 648 downloadmgr_i.c
            08/10/2003 18:30 9 031 downloadmgr_p.c
            4 fichier(s) 21 633 octets


            Comment

            Working...