2754|1

71

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

WinCE.net 调用QueryPerformanceCounter和QueryPerformanceCounter,失败! [复制链接]




  1. Public Class Form1

  2.     Private Declare Function QueryPerformanceCounter Lib "coredll" (ByVal lpPerformanceCount As Long) As Long
  3.     Private Declare Function QueryPerformanceFrequency Lib "coredll" (ByVal lpFrequency As Long) As Long


  4.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

  5.         Dim l As Long

  6.         If QueryPerformanceFrequency(l) Then

  7.             TextBox1.Text = l.ToString

  8.         End If

  9.         If QueryPerformanceCounter(l) Then
  10.             TextBox1.Text = TextBox1.Text & l.ToString
  11.         End If

  12.     End Sub
  13. End Class
复制代码



为什么 不走If里面走,总是失败(False)啊?

最新回复

应该是你的系统没有实现OEM层的OEMQueryPerformanceCounter以及OEMQueryPerformanceFrequency 函数. 而你所使用的函数正是通过以上两个函数的调用来实现的,所以在你调用以后就会返回false.. 添加 QueryPerformanceFrequency, QueryPerformanceCounter支持的请参照如下步骤: 1. Provide your own implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions. 2. Add code to OEMInit to set the variables pQueryPerformanceCounter and pQueryPerformanceFrequency to point to your implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions. 更详细的说明请参考msdn.   详情 回复 发表于 2009-12-22 14:10
点赞 关注

回复
举报

66

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
应该是你的系统没有实现OEM层的OEMQueryPerformanceCounter以及OEMQueryPerformanceFrequency 函数. 而你所使用的函数正是通过以上两个函数的调用来实现的,所以在你调用以后就会返回false..

添加 QueryPerformanceFrequency, QueryPerformanceCounter支持的请参照如下步骤:
1. Provide your own implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions.
2. Add code to OEMInit to set the variables pQueryPerformanceCounter and pQueryPerformanceFrequency to point to your implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions.
更详细的说明请参考msdn.
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表