Page 1 of 1

[Solved]SDK CoreTempProxy.GetTemp returns 0

Posted: Sat Jun 13, 2015 1:30 pm
by ThaPear
I'm trying to use the SDK to get the temperature of my CPU, but it returns 0 for every index I enter.

I downloaded the SDK from here.
CoreTemp itself is perfectly able to get my temperatures as seen here:
Image

I've created a new project and tried it with the most basic code I could think of, but it still doesn't work.
The mini project:

Code: Select all

#include <iostream>

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>

#include "CoreTempInterface/GetCoreTempInfo.h"

//#pragma comment(lib, "CoreTempInterface/lib/x64/GetCoreTempInfo.lib")
#pragma comment(lib, "CoreTempInterface/lib/x86/GetCoreTempInfo.lib")

int main()
{
	CoreTempProxy ctp;
	
	for(int i = 0; i < 256; ++i)
	{
		printf("temp %i = %f.\n", i, ctp.GetTemp(i));
	}

	system("pause");

	return 0;
}

Re: SDK CoreTempProxy.GetTemp returns 0

Posted: Tue Jun 16, 2015 2:19 pm
by The Coolest
I would suggest you first take a good look at the sample code provided with the SDK.
You must make a 'ctp.GetData();' call before you have access to temperature or any other data.

Re: SDK CoreTempProxy.GetTemp returns 0

Posted: Tue Jun 16, 2015 2:22 pm
by ThaPear
The Coolest wrote:I would suggest you first take a good look at the sample code provided with the SDK.
You must make a 'ctp.GetData();' call before you have access to temperature or any other data.
Thanks for the quick reply.
I had solved it but was unable to delete the post until it was accepted by a moderator.

Re: [Solved]SDK CoreTempProxy.GetTemp returns 0

Posted: Tue Jun 16, 2015 2:24 pm
by The Coolest
Oh, alright.
Glad you got it working :)