ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 4636|回复: 3

编译错误:发现二义性的名称:SendMessage

[复制链接]

TA的精华主题

TA的得分主题

发表于 2005-3-3 17:15 | 显示全部楼层 |阅读模式
这是什么意思啊.....如何解决
[此贴子已经被作者于2005-3-3 17:19:22编辑过]

编译错误:发现二义性的名称:SendMessage

编译错误:发现二义性的名称:SendMessage

TA的精华主题

TA的得分主题

发表于 2005-3-3 20:07 | 显示全部楼层
一般是因为定义了两个事件,比如:两个cmd.click单击事件,就不知道单击时执行哪个单击事件的代码了。

TA的精华主题

TA的得分主题

 楼主| 发表于 2005-3-4 09:32 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助

我查了下并没有啊.......公共模块里有

Declare Function adh_apiSendMessage Lib "USER32" Alias "SendMessageA" _ (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

' Create an Information Context Declare Function adh_apiCreateIC Lib "gdi32" Alias "CreateICA" _ (ByVal lpDriverName As String, ByVal lpDeviceName As String, _ ByVal lpOutput As String, lpInitData As Any) As Long ' Close an existing Device Context (or information context) Declare Function adh_apiDeleteDC Lib "gdi32" Alias "DeleteDC" _ (ByVal hdc As Long) As Long ================================

'拖动窗体的API Public Declare Function ReleaseCapture Lib "USER32" () As Long Public Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long '/* 常量声明部分 */ Public Const RGN_OR = 2 Public Const HTCAPTION = 2 Public Const WM_NCLBUTTONDOWN = &HA1

Public Declare Function DrawMenuBar Lib "USER32" (ByVal hWnd As Long) As Long Public Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Public Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Public Declare Function FindWindow Lib "USER32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Const GWL_STYLE As Long = (-16) Public Const WS_CAPTION As Long = &HC00000

'/* 类型声明部分 */ Public Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmHightBytes As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As Long End Type =========================

'声明必要的 API 例程: Declare Function FindWindow Lib "USER32" Alias _ "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As Long) As Long

Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public MyXL As Object =====================

Sub DetectExcel() '该过程检测并登记正在运行的 Excel。 Const WM_USER = 1024 Dim hWnd As Long '如果 Excel 在运行,则该 API 调用将返回其句柄。 hWnd = FindWindow("XLMAIN", 0) If hWnd = 0 Then '0 表示没有 Excel 在运行。 Exit Sub Else 'Excel 在运行,因此可以使用 SendMessage API '函数将其放入运行对象表。 SendMessage hWnd, WM_USER + 18, 0, 0 End If End Sub =================

Private Sub 主体_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) '单击主窗体可进行移动,代码来自模块 ReleaseCapture '释放鼠标 SendMessage hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&

End Sub -=====

就这些定义共公模块啊编译到这时

Private Sub 主体_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) '单击主窗体可进行移动,代码来自模块 ReleaseCapture '释放鼠标 SendMessage hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&

End Sub

提示二次定义啊..那里有问题吗

TA的精华主题

TA的得分主题

发表于 2005-3-4 22:52 | 显示全部楼层

搜索整个工程是否有 SENDMESSAGE

----------------------------------------- 版主打扰了,插播一条小广告请原谅:http://access911.net 作为中国ACCESS站点中第一个推出自主 RSS 定阅的站点,近期又将推出中国第一个讨论 ACCESS 应用的 WAP 站点,现在已经开始建站测试,请用你的手机访问 http://access911.net/wap,我也需要大量适合 WAP 手机访问的 ACCESS 原创文章,如有投稿请发MAIL 至 access911@etang.com

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

本版积分规则

关闭

最新热点上一条 /1 下一条

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-12-24 07:57 , Processed in 0.038585 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表