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. C / C++ / MFC
  4. uint64 in VC++ 6.0 Compiler?? [modified]

uint64 in VC++ 6.0 Compiler?? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++performance
7 Posts 4 Posters 0 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.
  • P Offline
    P Offline
    pavanbabut
    wrote on last edited by
    #1

    Hi, I wonder if unsigned 64bit integer is valid on a vc++ 6.0 compiler. In my application I have to use uint64 data type and whenever I try to use the command that is assigned to this, it fails. These are the two syntaxes that I have to use to define the buffers and the second one is for 64bit unsigned integer buffer on a system having a 64bit compiler and the first one is for systems with non-64bit compiler. If I have to use the first one, how can I define the low/high offsets and low/high transferlen. Suppose I want to start the buffer with zero offset and buffer length of 1024x1024bytes. //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64m(// Defines the transer buffer by using 2 x 32 bit unsigned integer values for each 64 bit value drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint32 dwBrdOffsH, // high part of offset in board memory uint32 dwBrdOffsL, // low part of offset in board memory uint32 dwTransferLenH, // high part of transfer buffer length uint32 dwTransferLenL); // low part of transfer buffer length //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64 (// Defines the transer buffer by using 64 bit unsigned integer values drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define as listed above uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint64 qwBrdOffs, // offset for transfer in board memory uint64 qwTransferLen); // buffer length thanks, -Pavan. -- modified at 18:07 Wednesday 8th November, 2006

    W M S 3 Replies Last reply
    0
    • P pavanbabut

      Hi, I wonder if unsigned 64bit integer is valid on a vc++ 6.0 compiler. In my application I have to use uint64 data type and whenever I try to use the command that is assigned to this, it fails. These are the two syntaxes that I have to use to define the buffers and the second one is for 64bit unsigned integer buffer on a system having a 64bit compiler and the first one is for systems with non-64bit compiler. If I have to use the first one, how can I define the low/high offsets and low/high transferlen. Suppose I want to start the buffer with zero offset and buffer length of 1024x1024bytes. //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64m(// Defines the transer buffer by using 2 x 32 bit unsigned integer values for each 64 bit value drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint32 dwBrdOffsH, // high part of offset in board memory uint32 dwBrdOffsL, // low part of offset in board memory uint32 dwTransferLenH, // high part of transfer buffer length uint32 dwTransferLenL); // low part of transfer buffer length //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64 (// Defines the transer buffer by using 64 bit unsigned integer values drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define as listed above uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint64 qwBrdOffs, // offset for transfer in board memory uint64 qwTransferLen); // buffer length thanks, -Pavan. -- modified at 18:07 Wednesday 8th November, 2006

      W Offline
      W Offline
      Waldermort
      wrote on last edited by
      #2

      Did you try using the LARGE_INTEGER struct?

      P 1 Reply Last reply
      0
      • W Waldermort

        Did you try using the LARGE_INTEGER struct?

        P Offline
        P Offline
        pavanbabut
        wrote on last edited by
        #3

        Sorry, didn't get you, I know there is LARGE_INTEGER data type, but where do you want me to use it?? This command is specific to the board driver that I am using. thanks, -Pavan

        1 Reply Last reply
        0
        • P pavanbabut

          Hi, I wonder if unsigned 64bit integer is valid on a vc++ 6.0 compiler. In my application I have to use uint64 data type and whenever I try to use the command that is assigned to this, it fails. These are the two syntaxes that I have to use to define the buffers and the second one is for 64bit unsigned integer buffer on a system having a 64bit compiler and the first one is for systems with non-64bit compiler. If I have to use the first one, how can I define the low/high offsets and low/high transferlen. Suppose I want to start the buffer with zero offset and buffer length of 1024x1024bytes. //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64m(// Defines the transer buffer by using 2 x 32 bit unsigned integer values for each 64 bit value drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint32 dwBrdOffsH, // high part of offset in board memory uint32 dwBrdOffsL, // low part of offset in board memory uint32 dwTransferLenH, // high part of transfer buffer length uint32 dwTransferLenL); // low part of transfer buffer length //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64 (// Defines the transer buffer by using 64 bit unsigned integer values drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define as listed above uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint64 qwBrdOffs, // offset for transfer in board memory uint64 qwTransferLen); // buffer length thanks, -Pavan. -- modified at 18:07 Wednesday 8th November, 2006

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Something like this?

          //Note: Intel x86 specific
          uint32 _stdcall spcm_dwDefTransfer_i64 (// Defines the transer buffer by using 64 bit unsigned integer values
          drv_handle hDevice, // handle to an already opened device
          uint32 dwBufType, // type of the buffer to define as listed above
          uint32 dwDirection, // the transfer direction as defined above
          uint32 dwNotifySize, // amount of bytes after which i want do receive
          void* pvDataBuffer, // pointer to the data buffer
          union
          {
          uint64 qwBrdOffs; // offset for transfer in board memory
          struct
          {
          uint32 dwBrdOffsL;
          uint32 dwBrdOffsH;
          };
          };
          union
          {
          uint64 qwTransferLen; // buffer length
          struct
          {
          uint32 dwTransferLenL;
          uint32 dwTransferLenH;
          };
          };

          *EDIT* Fixed some typing :) -- modified at 19:04 Wednesday 8th November, 2006

          P 1 Reply Last reply
          0
          • M Mark Salsbery

            Something like this?

            //Note: Intel x86 specific
            uint32 _stdcall spcm_dwDefTransfer_i64 (// Defines the transer buffer by using 64 bit unsigned integer values
            drv_handle hDevice, // handle to an already opened device
            uint32 dwBufType, // type of the buffer to define as listed above
            uint32 dwDirection, // the transfer direction as defined above
            uint32 dwNotifySize, // amount of bytes after which i want do receive
            void* pvDataBuffer, // pointer to the data buffer
            union
            {
            uint64 qwBrdOffs; // offset for transfer in board memory
            struct
            {
            uint32 dwBrdOffsL;
            uint32 dwBrdOffsH;
            };
            };
            union
            {
            uint64 qwTransferLen; // buffer length
            struct
            {
            uint32 dwTransferLenL;
            uint32 dwTransferLenH;
            };
            };

            *EDIT* Fixed some typing :) -- modified at 19:04 Wednesday 8th November, 2006

            P Offline
            P Offline
            pavanbabut
            wrote on last edited by
            #5

            I have no idea how their developers (strategic-test) have developed these two syntaxes. Maybe same as how you defined, but I am not sure. I have asked their technical support to rephrase my i64 command into i64m command. BTW how can we define the low and high addresses or lengths for a 64bit integer while accesses it in 32bit fashion?? -Pavan

            M 1 Reply Last reply
            0
            • P pavanbabut

              I have no idea how their developers (strategic-test) have developed these two syntaxes. Maybe same as how you defined, but I am not sure. I have asked their technical support to rephrase my i64 command into i64m command. BTW how can we define the low and high addresses or lengths for a 64bit integer while accesses it in 32bit fashion?? -Pavan

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              pavanbabut wrote:

              BTW how can we define the low and high addresses or lengths for a 64bit integer while accesses it in 32bit fashion

              With the structure I showed as an example you can access them either way - through the dw or the qw members. The struct will work for both 32 and 64 bit but that doesn't mean that's what the driver vendor does.

              1 Reply Last reply
              0
              • P pavanbabut

                Hi, I wonder if unsigned 64bit integer is valid on a vc++ 6.0 compiler. In my application I have to use uint64 data type and whenever I try to use the command that is assigned to this, it fails. These are the two syntaxes that I have to use to define the buffers and the second one is for 64bit unsigned integer buffer on a system having a 64bit compiler and the first one is for systems with non-64bit compiler. If I have to use the first one, how can I define the low/high offsets and low/high transferlen. Suppose I want to start the buffer with zero offset and buffer length of 1024x1024bytes. //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64m(// Defines the transer buffer by using 2 x 32 bit unsigned integer values for each 64 bit value drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint32 dwBrdOffsH, // high part of offset in board memory uint32 dwBrdOffsL, // low part of offset in board memory uint32 dwTransferLenH, // high part of transfer buffer length uint32 dwTransferLenL); // low part of transfer buffer length //************************************************************************* uint32 _stdcall spcm_dwDefTransfer_i64 (// Defines the transer buffer by using 64 bit unsigned integer values drv_handle hDevice, // handle to an already opened device uint32 dwBufType, // type of the buffer to define as listed above uint32 dwDirection, // the transfer direction as defined above uint32 dwNotifySize, // amount of bytes after which i want do receive void* pvDataBuffer, // pointer to the data buffer uint64 qwBrdOffs, // offset for transfer in board memory uint64 qwTransferLen); // buffer length thanks, -Pavan. -- modified at 18:07 Wednesday 8th November, 2006

                S Offline
                S Offline
                Steve S
                wrote on last edited by
                #7

                Why not use typedef unsigned __int64 uint64; typedef __int64 int64; Which gives you easy to use 64 bit types just like unsigned/signed ints of other sizes, and then use unions as shown above to deal with the component parts?

                Steve S Developer for hire

                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