Announcement

Collapse
No announcement yet.

Win32api question

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

  • Win32api question

    In the Win32api.inc file, what is the derivation of the values assigned to the various equates? Are they specific to the compiler or are they drawn from the values in the Win32 OS?

    Stan
    Do not go quiet into that good night,
    ... Rage, rage against the dark.

  • #2
    The numeric value is not changed from the original inc files from M$.

    Do you have a specific question ?
    Last edited by Michael Mayerhoffer; 20 Aug 2008, 05:51 PM.
    A dozen what.

    Comment


    • #3
      Michael,

      Thanks for the reply. The reason I'm asking is that we're noticing differences in the values between the Win32api and the VB 6.0 documentation regarding the values assigned to built-in VB compiler constants. I'm thinking that if the Win32api.inc file uses the OS defined values we can implement PB SDK style code to accomplish some translations from VB.

      thanks,
      Stan
      Do not go quiet into that good night,
      ... Rage, rage against the dark.

      Comment


      • #4
        I think the only difference is base ten vs oct and so on...


        If a api function needs value of 1000 , it could be represented by decimal, octal or hex,,,so at a quick glance it might look different.

        Some internal reference in VB ...that would be a case by case.
        Last edited by Michael Mayerhoffer; 20 Aug 2008, 06:14 PM.
        A dozen what.

        Comment


        • #5
          Stan,
          If I read you right, then my reply is Do NOT trust anything equated in VB
          (or at least not 99%)

          That said, I will attempt to explain why.
          1. VB is VERY Forgiving over badly written code
          2. Most examples lead you down the wrong path (just cause "It Works" does not mean its coded correctly
          3. Did I mention VB is VERY Forgiving over badly written code


          Coming from a VB6 side, I have often found many errors in my original code that I had no idea about, because I used the class module (or definition) as it was used by whoever wrote it before me (and obviously TOTALLY misunderstood it), but it seemed to be part of the typical example.....so it must have been right (or to some point anyways)

          I noticed your comment of
          I think the only difference is base ten vs oct and so on...


          If a api function needs value of 1000 , it could be repesented by decimal, octal or hex,,,so at a quick glance it mught look different.
          So I think you are already on the right track of translation from VB to PB, because you already know the differences of
          %MyVariable = 1
          For those reading and don't see it....
          %MyVariable = 1 ..... Simple right????... WRONG!!!!

          1 = 1 WHAT???
          1 Hex???
          1 Binary???
          1 Decimal???
          1 OCT???
          1 Rabbit???
          1 Orange???
          1 Apple???
          (ok enough comparisons )

          Usually this causes no problems because they all equal 1 "Something"...
          What that "Something" may really be, is up to the coder that wrote it and in the context of the compiler and definition of the "Units" or "DataType"

          I won't speak for PB, but their *.INC files are the best match to the original meaning of a value that I have seen so porting from other languages is at worst case (ripping a bandaid off my arm) concept....(Usually I don't have to do it, but when I do have to....it only smarts a second, and then I got it)

          Rough guesstimation though...I would say all hex, although not obvious sometimes unless the value assigned is crossing a border of "LONG vs DWORD vs CURRENCY vs SomeOtherDataType" sort of boundry

          Short Answer though... I would guestimate at least 80% or more of your code can quickly be ported from VB to PB
          Engineer's Motto: If it aint broke take it apart and fix it

          "If at 1st you don't succeed... call it version 1.0"

          "Half of Programming is coding"....."The other 90% is DEBUGGING"

          "Document my code????" .... "WHYYY??? do you think they call it CODE? "

          Comment


          • #6
            Originally posted by Cliff Nichols View Post
            Stan,
            If I read you right, then my reply is Do NOT trust anything equated in VB
            (or at least not 99%)

            That said, I will attempt to explain why.
            1. VB is VERY Forgiving over badly written code
            2. Most examples lead you down the wrong path (just cause "It Works" does not mean its coded correctly
            3. Did I mention VB is VERY Forgiving over badly written code ...
            I'm usually working with somebody else's code when I do this. I know VB is very forgiving, but sometimes I get to find out just how forgiving.

            Stan
            Do not go quiet into that good night,
            ... Rage, rage against the dark.

            Comment


            • #7
              I give you Mouse Pointer constants/equates
              values between the pipe characters, VB term and value first.
              Code:
              -| vbArrow        | 1|%IDC_ARROW    |32512&| Arrow
              -| vbCrosshair    | 2|%IDC_CROSS    |32515&| Cross
              -| vbIbeam        | 3|%IDC_IBEAM    |32513&| I beam
              -| vbIconPointer  | 4|%IDC_ICON     |32641&| Icon
              -| vbSizePointer  | 5|%IDC_SIZE     |32640&| Size
              -| vbSizeNESW     | 6|%IDC_SIZENESW |32643&| Size NE/SW
              -| vbSizeNS       | 7|%IDC_SIZENS   |32645&| Size N/S
              -| vbSizeNWSE     | 8|%IDC_SIZENWSE |32642&| Size NW/SE
              -| vbSizeWE       | 9|%IDC_SIZEWE   |32644&| Size W/E
              This is the type of thing I believe that Stan was referring to.

              The only reference in the SDK that I've found does not give values for the equates, which only differ from the PB equates because PB includes the '%' character. So far.
              Last edited by Rodney Hicks; 20 Aug 2008, 07:29 PM. Reason: add info
              Rod
              In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

              Comment


              • #8
                Don't feel bad Stan....I am AMAZED how many "VB Refugee's" I have seen, and others that just get what we meant when asking for help.

                No matter the port...I am sure there is someone here that can help out at stuck points

                Engineer's Motto: If it aint broke take it apart and fix it

                "If at 1st you don't succeed... call it version 1.0"

                "Half of Programming is coding"....."The other 90% is DEBUGGING"

                "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                Comment


                • #9
                  There is a distinction between API, internal reference on VB code not to mention poorly written VB Code .

                  Ok then, I made a VB to PB code converter at the same time I made MakeDDT. around 97 or 98

                  I was using to convert stuff from VB to PB, I stopped using it, because to many problems with poorly written code.

                  like example textbox.txt = 7

                  opposed to using textbox.txt= str$ ( 7)

                  This would only scratch the surface since VB would guess what you want not what you meant


                  Stan do you have a repository or a form ? If I can find the source , I would donate what I have and or time as I have time..
                  A dozen what.

                  Comment


                  • #10
                    I know I've pointed out here before that any Windows header files for use with PB or VB or COBOL or anything else are someone's subjective interpretation of the Microsoft-provided files written for use with "C".

                    It can't be all bad to maintain a set of the C-language originals for reference as part of your development library. (I got my set by downloading the freeware Borland C compiler).

                    MCM
                    Michael Mattias
                    Tal Systems (retired)
                    Port Washington WI USA
                    [email protected]
                    http://www.talsystems.com

                    Comment


                    • #11
                      Originally posted by Michael Mayerhoffer View Post
                      There is a distinction between API, internal reference on VB code not to mention poorly written VB Code .

                      Ok then, I made a VB to PB code converter at the same time I made MakeDDT. around 97 or 98
                      ...
                      Stan do you have a repository or a form ? If I can find the source , I would donate what I have and or time as I have time..
                      Michael,

                      Brian Chirgwin has set up SVN for the project. If you PM him, he can fill you in on the details.

                      We gladly accept your offer of code and/or time.

                      Stan
                      Do not go quiet into that good night,
                      ... Rage, rage against the dark.

                      Comment


                      • #12
                        Originally posted by Michael Mattias View Post
                        ...
                        It can't be all bad to maintain a set of the C-language originals for reference as part of your development library. (I got my set by downloading the freeware Borland C compiler).

                        MCM
                        MCM,

                        Actually, this is a good idea. I found the MS C structures on MSDN and started building such an animal this week. Once we got into the guts of VB6, it was necessary to seriously rethink some of our original assumptions.


                        Stan
                        Do not go quiet into that good night,
                        ... Rage, rage against the dark.

                        Comment


                        • #13
                          To all,

                          thanks for the feedback.

                          I have to defer to Rod on definition of the question because he's the one doing yeoman's work on this issue.


                          Originally posted by Rodney Hicks View Post
                          ...
                          This is the type of thing I believe that Stan was referring to.

                          The only reference in the SDK that I've found does not give values for the equates, which only differ from the PB equates because PB includes the '%' character. So far.
                          Stan
                          Do not go quiet into that good night,
                          ... Rage, rage against the dark.

                          Comment


                          • #14
                            Rodney points out rc equates per say.

                            MS Windows platform sdk does have all the info you need and then some.
                            It has the includes and header files. It is like the WINAPI32 help on steroids.

                            Windows xp sp2 sdk is the best for older stuff and still around.

                            The newer ones have stuff you need too. I do have the XPSP2 sdk. It is truly buried on MSDN just hard to find. I have it booked marked, just not on this ista an OS wana be.

                            I will post link to it later today or tomorrow.
                            A dozen what.

                            Comment


                            • #15
                              download, software, update, Microsoft, product, computer, PC, Windows, Office, server, MSN, Live, game, Xbox, security, driver, install, trial, preview, demo, popular
                              A dozen what.

                              Comment

                              Working...
                              X