Announcement

Collapse
No announcement yet.

Again: C to PB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Again: C to PB

    C just keeps on amazing me... I'm translating SetupApi.h and found some items I'm
    uncertain how to translate.
    Code:
    SetupDiGetSelectedDriverW(
        IN  HDEVINFO           DeviceInfoSet,
        IN  PSP_DEVINFO_DATA   DeviceInfoData, OPTIONAL
        OUT PSP_DRVINFO_DATA_W DriverInfoData
        );
    The IN and OUT, are they of any use, or purely informational?
    (I presume OPTIONAL is what it says to be, although the C docs says that a parm can only be
    optional if its the last one, or the rest is also optional...)

    Is there any difference between those 2 defines:
    Code:
    #define SPDRP_HARDWAREID                  (0x00000001)  // HardwareID (R/W)
    #define DIREG_DEV                          0x00000001   // Open/Create/Delete device key
    Maybe there already is a translation of the SetupApi header somewhere? Would save me a C++ headache

    ------------------
    Regards,
    Peter

    [This message has been edited by Peter Lameijn (edited December 11, 2003).]
    Regards,
    Peter

  • #2
    i am guessing, but it would be my guess that IN, OUT, and OPTIONAL are macros.
    can you find the definition for them somewhere?

    --don

    ------------------
    Don Dickinson
    Author of ddoc Print and Preview A dll-based print-preview engine for windows
    www.greatwebdivide.com
    Author of Tsunami Tcp Data Server
    http://ttds.greatwebdivide.com
    Don Dickinson
    www.greatwebdivide.com

    Comment


    • #3
      Thanks, I'll see what I can dig up. Got additional one:
      Code:
      typedef PVOID HSPFILEQ
      Is this equal to:
      Code:
      Dim HSPFILEQ As Dword

      ------------------
      Regards,
      Peter
      Regards,
      Peter

      Comment


      • #4
        Peter,

        I don't know if this applies, but I read up on RPC and IN and OUT were macros for an intermedia compiler to let the RPC server/client know whether to send or recieve (or both?) a variable across the network. The idea is, if a variable is set by the remote procedure then you don't have to send it. Also if the variable is byval then you don't have to return it.

        Russ Srole

        ------------------
        "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

        Comment


        • #5
          Hi Peter,

          You will find these defined types IN OUT OPTIONAL in WinDef.h

          [CODE}
          #ifndef IN
          #define IN
          #endif


          #ifndef OUT
          #define OUT
          #endif


          #ifndef OPTIONAL
          #define OPTIONAL
          #endif
          [/CODE]

          IN means the parameter is an input parameter.
          OUT means the parameter is an output parameter.
          OPTIONAL means that the parameter is optional.

          They also use these in defining functions in the .tlb files.

          Hope this helps

          Enjoy
          Ray

          P.S.
          But as you can see the defines are not assigned any values, now how
          would you tell PB this?

          ------------------
          Raymond L. King
          Custom Software Designers.

          http://www.csdsoft.com
          mailto:[email protected][email protected]</A>



          [This message has been edited by Raymond King (edited December 11, 2003).]
          Raymond L. King
          eBook Home Biz.

          http://www.ebook-home-biz.com
          mailto:[email protected]ebook-home-biz.com[email protected]</A>

          Comment


          • #6
            They are defined as nothing... which you can readily enough implement
            in PowerBASIC by the simple expedient of leaving them out.

            ------------------
            Tom Hanlin
            PowerBASIC Staff

            Comment


            • #7
              Thanks Tom,

              I was wondering if that would work thanks again. Like always your
              here to answer our questions.

              Enjoy
              Ray


              ------------------
              Raymond L. King
              Custom Software Designers.

              http://www.csdsoft.com
              mailto:[email protected][email protected]</A>
              Raymond L. King
              eBook Home Biz.

              http://www.ebook-home-biz.com
              mailto:[email protected][email protected]</A>

              Comment

              Working...
              X