标题:[求助]"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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-504975-1-1.html




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

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