| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1169 人关注过本帖
标题:[求助]"AddressOf”表达式无法转换为“Integer ”,因为“Integer”不是委托 ...
只看楼主 加入收藏
VB蛋儿疼
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2021-2-28
收藏
 问题点数:0 回复次数:0 
[求助]"AddressOf”表达式无法转换为“Integer ”,因为“Integer”不是委托类型。
报错语句:
TimerID = SetTimer(FormHwnd, 0, 100, AddressOf TimerProc)

相关语句:
    Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Int32, ByVal nIDEvent As Int32, ByVal uElapse As Int32, ByVal lpTimerFunc As Int32) As Int32
   
Sub TimerProc(ByVal hwnd As Int32, ByVal uMsg As Int32, ByVal idEvent As Int32, ByVal lngSysTime As Int32)
        Dim OldMousePos As POINTAPI, NewMousePos As POINTAPI

        Dim FormRECT As RECT
        Dim FormWidth As Int32, FormHeight As Int32
        GetCursorPos(NewMousePos)
        If NewMousePos.x = OldMousePos.x And NewMousePos.y = OldMousePos.y Then Exit Sub
        OldMousePos = NewMousePos
        GetWindowRect(FormHwnd, FormRECT)
        FormDC = GetWindowDC(FormHwnd)
        DeskDC = GetWindowDC(0)
        FormWidth = FormRECT.Right - FormRECT.Left
        FormHeight = FormRECT.Bottom - FormRECT.Top
        UpdateWindow(FormHwnd)
        StretchBlt(FormDC, 0, 0, FormWidth, FormHeight, DeskDC, NewMousePos.x - FormWidth / 2 / ZoomCount, NewMousePos.y - FormHeight / 2 / ZoomCount, FormWidth / ZoomCount, FormHeight / ZoomCount, SRCCOPY)
        ReleaseDC(FormHwnd, FormDC)
        ReleaseDC(0, DeskDC)
    End Sub
感谢能有高手指点下。
搜索更多相关主题的帖子: Dim Integer Sub AddressOf ByVal 
2021-02-28 14:23
快速回复:[求助]"AddressOf”表达式无法转换为“Integer ”,因为“Integer”不 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016213 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved