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