casting problems for int
-
unsigned int it = V_INT(&PhysicalMemoryVal);
Does this actually make sense here or is there some problems with the pointers We have a mathematician, a different kind of mathematician, and a statistician! -
Interesting. What is PhysicalMemoryVal? Looks like you are casting its memory address, not what is occupied in memory. kuphryn
Thats what I tought, how do I get the proper value please???? Oh by the way PhysicalMemoryVal is the amount of memory the operating system has available, you get it from WMI classes We have a mathematician, a different kind of mathematician, and a statistician!
-
Thats what I tought, how do I get the proper value please???? Oh by the way PhysicalMemoryVal is the amount of memory the operating system has available, you get it from WMI classes We have a mathematician, a different kind of mathematician, and a statistician!
-
Given that PhysicalMemoryVal is a memory address, one possible solution is pointer. unsigned int *pValue = PhysicalMemoryVal; Kuphryn
no good, now I get and error error C2440: 'initializing' : cannot convert from 'INT' to 'unsigned int *' But I dont understand because I use another function in the same way only it return a 16 bit int and there seems to be no problem there We have a mathematician, a different kind of mathematician, and a statistician!
-
Given that PhysicalMemoryVal is a memory address, one possible solution is pointer. unsigned int *pValue = PhysicalMemoryVal; Kuphryn
Actually!!!! how do i declare a 64 bit int???????? uint64????? We have a mathematician, a different kind of mathematician, and a statistician!
-
Actually!!!! how do i declare a 64 bit int???????? uint64????? We have a mathematician, a different kind of mathematician, and a statistician!
Check out MSDN. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/windows\_data\_types.asp Check out my website for more links on software development. http://www.dslextreme.com/users/kuphryn/links.html Kuphryn
-
unsigned int it = V_INT(&PhysicalMemoryVal);
Does this actually make sense here or is there some problems with the pointers We have a mathematician, a different kind of mathematician, and a statistician!What type is
PhysicalMemoryVal
? Your code will only work if it is aVARIANT
.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
Actually!!!! how do i declare a 64 bit int???????? uint64????? We have a mathematician, a different kind of mathematician, and a statistician!
roadragedave wrote: how do i declare a 64 bit int????????
__int64
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
What type is
PhysicalMemoryVal
? Your code will only work if it is aVARIANT
.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
Yes PhysicalMemoryVal is a VARIANT The value returns something, but its a negative number which doesnt make any sense http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_operatingsystem.asp at this website you will find a
uint64 FreePhysicalMemory
Im trying to plot this against anothervalue uint64 TotalVisableMemorySize
but the values Im getting are way out My GetProperty method for getting the values works fine, because I have it fetching another value without any problems. -
Yes PhysicalMemoryVal is a VARIANT The value returns something, but its a negative number which doesnt make any sense http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_operatingsystem.asp at this website you will find a
uint64 FreePhysicalMemory
Im trying to plot this against anothervalue uint64 TotalVisableMemorySize
but the values Im getting are way out My GetProperty method for getting the values works fine, because I have it fetching another value without any problems.IWbemClassObject *pClass;
_variant_t v;
HRESULT hr;hr = pClass->Get(L"FreePhysicalMemory", 0, &v, NULL, NULL);
if (SUCCEEDED(hr) && VT_NULL != v.vt)
TRACE("FreePhysicalMemory = %S KB\n", V_BSTR(&v));hr = pClass->Get(L"TotalVisibleMemorySize", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
TRACE("TotalVisibleMemorySize = %S KB\n", V_BSTR(&v));
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)