以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [原创]全局代码报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=108934) |
-- 作者:天一生水 -- 发布时间:2017/11/1 9:36:00 -- [原创]全局代码报错 嵌入exe程序到当前窗口的全局代码,原封不动的复制进项目,保存时报错:
全局代码:
<DllImport("user32.dll", EntryPoint := "FindWindow")> _ <DllImport("user32.dll", EntryPoint := "SetParent")> _ Public Declare Function MoveWindow Lib "user32" (ByVal hwnd As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Integer) As Integer Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Integer, ByVal wCmd As Integer) As Integer <DllImport("user32.dll", SetLastError:=True)> _
Public Function EnumWindowsProcCallBack(ByVal hwnd As Integer, ByVal lParam As Integer) As Boolean Public Const GW_HWNDFIRST =0 Public jbs As new List (of String) |
-- 作者:有点甜 -- 发布时间:2017/11/1 9:48:00 -- 代码没有问题,你应该在全局代码,还写有了类似的相同的代码,比如,下面的代码,如果写了两次,就有问题
<DllImport("user32.dll", EntryPoint := "FindWindow")> _
<DllImport("user32.dll", EntryPoint := "FindWindow")> _ |
-- 作者:天一生水 -- 发布时间:2017/11/1 14:42:00 -- 谢谢田老师! 还剩下一句代码有冲突,去掉哪一边都不行,合在一起也不行,改不了: Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Integer) As Integer 这句与“无边框可移动”的一句全局代码有冲突: Private Declare Function ReleaseCapture Lib "user32" () As Long |
-- 作者:有点甜 -- 发布时间:2017/11/1 15:50:00 -- 删掉这句
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer,ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Integer) As Integer |