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. error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64

error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
4 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.
  • V Offline
    V Offline
    V K 2
    wrote on last edited by
    #1

    Hi, My code is as below MEMORYSTATUSEX msex; GlobalMemoryStatusEx(&msex); DWORD dwBytesPerMB = 1024 * 1024; m_RAM = (float)msex.ullTotalPhys / (float)dwBytesPerMB; m_RAM = (float) ( m_RAM * 1.01 ); (Getting compilation error at this point) Can I know how to fix this.. Thanks...

    C S M 3 Replies Last reply
    0
    • V V K 2

      Hi, My code is as below MEMORYSTATUSEX msex; GlobalMemoryStatusEx(&msex); DWORD dwBytesPerMB = 1024 * 1024; m_RAM = (float)msex.ullTotalPhys / (float)dwBytesPerMB; m_RAM = (float) ( m_RAM * 1.01 ); (Getting compilation error at this point) Can I know how to fix this.. Thanks...

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      It would help a lot if you could tell us the types of the different variables that you are using in your code snippet. On the other hand, did you try what the compiler suggested you: using a signed __int64 instead of an unsigned __int64 ?

      Cédric Moonen Software developer
      Charting control [v2.0] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • V V K 2

        Hi, My code is as below MEMORYSTATUSEX msex; GlobalMemoryStatusEx(&msex); DWORD dwBytesPerMB = 1024 * 1024; m_RAM = (float)msex.ullTotalPhys / (float)dwBytesPerMB; m_RAM = (float) ( m_RAM * 1.01 ); (Getting compilation error at this point) Can I know how to fix this.. Thanks...

        S Offline
        S Offline
        Stuart Dootson
        wrote on last edited by
        #3

        The implication from the error message you've posted is that m_RAM has type unsigned __int64 (it'll try to convert it to double when you multiply by 1.01). You could either a) change the type of m_RAM to signed __int64 (as indicated by the error message), or b) alter the expression causing the error. How about:

        m_RAM = m_RAM + (m_RAM / 100);

        ? That might not give exactly the same result, but it'll probably be close enough!

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        1 Reply Last reply
        0
        • V V K 2

          Hi, My code is as below MEMORYSTATUSEX msex; GlobalMemoryStatusEx(&msex); DWORD dwBytesPerMB = 1024 * 1024; m_RAM = (float)msex.ullTotalPhys / (float)dwBytesPerMB; m_RAM = (float) ( m_RAM * 1.01 ); (Getting compilation error at this point) Can I know how to fix this.. Thanks...

          M Offline
          M Offline
          Michael Schubert
          wrote on last edited by
          #4

          You can remedy this by applying the processor pack for VC6 (I'm assuming that you're using VC6): http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx[^]

          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