Page 1 of 1

CoreTemp DLL sample for Visual Basic 6

Posted: Sat Jun 05, 2010 12:59 am
by Dr.InSide
Hello.

If someone need it ...

I have created a CoreTemp DLL sample project for Visual Basic 6.0.

The sample can be downloaded HERE.

Image

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Sat Jun 05, 2010 7:53 am
by The Coolest
Cool. Thanks for the contribution.

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Sun Jun 06, 2010 7:59 am
by wky
The file is broken, only few bytes.
Can u upload again

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 7:23 pm
by Dr.InSide
Sorry!
In my php script had an error.
Now it should work again.

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 8:16 pm
by The Coolest
Very nice.
But there seems to be a slight problem.
Core Temp apparently doesn't reset the whole character array of the processor name to zero or null. In your code you only remove nulls from the namestring.
This is the result:
Image

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 9:33 pm
by Dr.InSide
I had already removed the zero. Apparently there were problems
with Unicode conversion. Now it should work everywhere.
The new version is now on my server.

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 9:43 pm
by The Coolest
Sorry to say, but the problem persists.

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 9:53 pm
by Dr.InSide
On my computers, I can not experience the problem.
I have no idea why. See picture.

Image

That's the function:

Code: Select all

Public Function ByteArrayToString(ByteArray() As Byte) As String
  Dim B As Variant
  For Each B In ByteArray()
    If Not B = 0 Then
      ByteArrayToString = ByteArrayToString & Chr$(B)
    End If
  Next
End Function

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 10:06 pm
by The Coolest
You should break the loop when you reach the first null character, since in the C/C++ language null represents the end of a string.

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 10:21 pm
by Dr.InSide
Ok. Thanks for the information. The loop will now leave
at the first null. I hope it works correctly now.

Code: Select all

Public Function ByteArrayToString(ByteArray() As Byte) As String
  Dim B As Variant
  For Each B In ByteArray()
    If B = 0 Then Exit For
    ByteArrayToString = ByteArrayToString & Chr$(B)
  Next
End Function

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 10:23 pm
by The Coolest
Great, problem solved :)

Image

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 01, 2010 10:32 pm
by Dr.InSide
Yeah! Wonderful! :mrgreen:
Thanks for testing!

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Mon Jul 12, 2010 6:09 pm
by Dr.InSide
@The Coolest:

There is a newer version of GetCoreTempInfo.dll available (without .Net)?
I use Version 1.0 from 2008. It does not work with Intel Atom CPU.

It would be great if there exists a newer version. I extend my very old
CPU-Monitor and is now using your DLL.

Note: The CPU-Monitor is at moment only in German language available.

Image

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Mon Jul 12, 2010 8:42 pm
by The Coolest
Could you explain the problem with the DLL and Atom CPU?

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 15, 2010 5:53 am
by Dr.InSide
I have tested the DLL on a newer Netbook (Atom N455, Windows7), there
works it, but reports no CPUname (string is empty).

On my old ASUS EEE PC 901 (Atom N270) does works the DLL. But the
reported temperature is apparently too low. After switch power on report
it 0 °C, during operation 15-20 °C.

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Thu Jul 15, 2010 6:20 am
by The Coolest
Actually that is a Core Temp issue, you should be able to see that Core Temp does show a processor name either.
It should be fixed in the next release.

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Mon Jan 06, 2014 5:01 pm
by alcpuGeek
Was the fixed version (with breaking on null) updated in the same .zip of the initial post? Or should I browse the server for the updated version? Thanks in advance

Good job btw!

Re: CoreTemp DLL sample for Visual Basic 6

Posted: Sun Apr 05, 2020 11:58 pm
by flyguille
this example doesn't work anymore on modern win10 64bits platform, include I tried with the last published dll, it returns FALSE calling the dll. ¿Any idea why?