主题:这个API怎么用?为什么会出错?????????
刚刚在用shell execute这个API,运行时出现了错误.
这是这个API的声明:
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
这是调用时的语句:
Call ShellExecute(0, "open", OpenFileDialog1.FileName, vbNullString, vbNullString, vbNormalFocus)
运行时出现下面的错误:
Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 'D:\变化计数器\bin\变化计数器.vshost.exe'.
Additional Information: 对 PInvoke 函数“变化计数器!变化计数器.Form1::ShellExecute”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。
不知如何解决????
这是这个API的声明:
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
这是调用时的语句:
Call ShellExecute(0, "open", OpenFileDialog1.FileName, vbNullString, vbNullString, vbNormalFocus)
运行时出现下面的错误:
Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 'D:\变化计数器\bin\变化计数器.vshost.exe'.
Additional Information: 对 PInvoke 函数“变化计数器!变化计数器.Form1::ShellExecute”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。
不知如何解决????