Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New FAQ on how to create a VFP FLL with Visual C++ 1

Status
Not open for further replies.

rob444

Programmer
Nov 5, 2002
633
NL
Being requested to do so I've created a FAQ on how to create a VFP FLL with Visual C(++)

faq184-6347

Rob.
 
Great Job!!!
 
I've tried to follow this through in Visual C++ 6.0 - but a number of items mentioned in the dialogues do not appear.

Is there any chance of getting the CPUSpeed fll?


Thanks PW
 
Rob,
Downloaded it and tried it, and have a question... when I issue:

? CPUSPEED()

I get the result
1531.78651413

When I issue:

MESSAGEBOX(CPUSPEED())

I get the result
1729.11414863

Why are they so different?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott,
I can't replicate your problem.
With VFP9 I get (almost) identical cpu speeds

What VFP version are you using?
Rob.
 
Scott,
CPUSpeed returns a double, so for useage in messagebox you should convert the result of CPUSpeed to a string.

Perhaps that gives you identical readings...

Rob.
 
I'm using VFP9 SP1 on a IBM T43 Thinkpad laptop.

I just created a small table called CPUSPEEDS with a feild CPUSPEED

and issued:

INSERT INTO cpuspeeds (CPUSPEED) VALUES (CPUSPEED())

6 times. These the results I got, which I find even more amusing:

1478.32801427
1555.65043607
1543.37119710
1413.92967943
1578.01672302
1445.43117135


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Rob,
The field was a Numeric 15 digits, with 8 decimal places.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Rob,
MESSAGEBOX() does not require a value to be converted to a string, and would make no difference to the test, since that conversion would take place AFTER the CPUSPEED() function would have already run. I would only need ot convert it to a string for MESSAGEBOX() If I wanted to append text to it like:

MESSAGEBOX("Your CPU Speed is: "+ALLTRIM(STR(CPUSPEED(),15,8)))


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Will try this on my home PC and see what kind of results I get later tonight.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I don't know if its the case but laptops have an energy saving mode that somethimes slows down the processor in order to save energy.
Perhaps that is what you're seeing on your laptop...

Regards,
Rob.
 
Have tried it on my Home PC P4 1.8Ghz machine now... I get some variance (from 1817 to 1875) with both Messagebox and ? but never below the 1.8Ghz range, and a little CPU utilization I can understand... the laptop thing is very curious though.In any case, still a handy thing to have around. When I got variance of 1.4 to 1.7 it's still generally good enough to test "Is this PC fast enough to run my application". Will play around with more PCs and see what kind of response I get.

Thanks for this handy little FLL.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I've run the cpuspeed() 20 times on my pc at home and there isn't any significant variance in the returned speed...

I don't know why you experience that variance...

Regards,
Rob.
 
Rob,

Thank you very much for posting the most useful fll.

The next step in making a comprehensive 'performance indicator' may be to test the hard drive read/write speed ,the processor type and installed RAM - as CPU frequencies are only one part of the equation.

The intention would be to warn users of older PCs that processing time may be extended.

Thanks again

PW
 
@wetton,

I'm planning to create a FLL with which you can get all details on available cpu's and available RAM but it is quite a bit of work.

When its done I'll release it here, but don't hold your breath...

Rob.
 
Rob,

That's great news and I'm excited by it - I only wish I had the skills ....


PW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top