我正在尝试运行以下代码:
Public Class Form1
Public Declare Function GetModuleFileNameEx Lib "PSAPI.DLL" (ByVal hProcess As Integer, ByVal hModule As Integer, ByRef lpFilename As String, ByVal nSize As Integer) As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim _intLen As Integer
Dim lpFilename As String
Dim nSize As Integer
lpFilename = ""
'get process file path
_intLen = GetModuleFileNameEx(10000, 0, lpFilename, nSize)
End Sub
End Class
但我一直得到一个entrypointnotfound异常:
任何想法?
答案 0 :(得分:0)
确定找到了解决方案:
Public Class Form1
Public Declare Function GetModuleFileNameExW Lib "PSAPI.DLL" (ByVal hProcess As Integer, ByVal hModule As Integer, ByRef lpFilename As String, ByVal nSize As Integer) As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim _intLen As Integer
Dim lpFilename As String
Dim nSize As Integer
lpFilename = ""
'get process file path
_intLen = GetModuleFileNameExW(10000, 0, lpFilename, nSize)
End Sub
End Class