VB 仓库管理系统有一个问题 请大家帮忙!!!

来源:百度知道 编辑:UC知道 时间:2024/06/21 06:44:16
al lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

编译错误:
在End Sub、End Function 或End 属性后面只能出现注释

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
是一段源代码

请大家帮忙一下,如果能解决的话,我会直接送50分。

这个函数没问题,是你程序中的其它问题吧,把其它(出错部分)的代码贴出来看看。

=====================
如果是在窗体模块用Public定义这函数,应该提示这个错误:
“常数、固定长度字符串、数组、自定义类型与 Declare 语句不能是对象模块中的 Public 成员

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

这个代码要是在模块里应该没有错误。如果是在窗体里 把Public改成Private试试