| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 747 人关注过本帖
标题:重大问题,生成exe就不能运行
只看楼主 加入收藏
笑书棋苑
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-8-31
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
重大问题,生成exe就不能运行
在vb模式可以测试运行无误,生成exe后就不能正常运行
  主要是坐标函数问题,因为y轴我用的是text
不知道为什么不行  谁能告诉我
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
    Private Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal Y As Integer) As Boolean
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Const MOUSEEVENTF_RIGHTDOWN = &H8
    Private Const MOUSEEVENTF_RIGHTUP = &H10
   
   
'热键声明部分
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI '定义点(Point)结构
y2 As Long '点在Y坐标(纵坐标)上的坐标值
End Type


Private Sub Timer1_Timer()
                        SetCursorPos 819, Int(y2) * 16 + 388
                        mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
                        Sleep 40
                        mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
                        Sleep 40
                        SetCursorPos 700, Int(y2) * 16 + 464
                        mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
                        Sleep 40
                        mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Private Sub Timer2_Timer()
If GetAsyncKeyState(vbKeyF2) Then
Timer1.Enabled = True
End If
If GetAsyncKeyState(vbKeyF5) Then
Timer1.Enabled = False
End If
End Sub

Private Sub tiren_Click()
Form2.Show
Unload Form3
End Sub

Private Sub y2_Change()
End Sub
Private Sub yingdong_Timer()
If zimu.SelStart < Len(zimu.Text) - 3 Then
zimu.SelStart = zimu.SelStart + 1
zimu.SelLength = 1
Else
zimu.SelStart = 0
zimu.SelLength = 1
End If
End Sub
---------------------------
这是我的代码,中间有一些无关的代码就没贴出来了。
搜索更多相关主题的帖子: exe 运行 
2010-08-31 23:16
wwf3045
Rank: 2
等 级:论坛游民
威 望:1
帖 子:25
专家分:69
注 册:2010-8-25
收藏
得分:20 
把user32.dll放到EXE文件相同的目录下试试
2010-09-05 13:49
快速回复:重大问题,生成exe就不能运行
数据加载中...
 
   



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

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