Modify ↓
Opened 17 years ago
Closed 17 years ago
#833 closed Bug (No Bug)
Bug in function DllOpen ()
| Reported by: | fristo | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.0.0 | Severity: | None |
| Keywords: | Cc: |
Description
A Dll that not exist can not provide a handle. In this case the DllOpen function return value @error should set to -1.
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: fristo
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
Local $nameDll="netapi32.dll"
Local $Netapi
$Netapi = DllOpen($nameDll)
MsgBox(64, "@ERROR Of DllOpen", "Call DllOpen (" & $nameDll & ")" & @CRLF & @CRLF & "@error = " & @error)
DllClose($Netapi)
ExistDLL ($nameDll)
$nameDll="net___api32.dll"
$Netapi = DllOpen($nameDll)
MsgBox(48, "@ERROR Of DllOpen", "Call DllOpen (" & $nameDll & ")" & @CRLF & @CRLF & "@error = " & @error)
DllClose($Netapi)
ExistDLL ($nameDll)
Exit
; =============================================================================
Func ExistDLL ($name)
Local $fullName = @SystemDir & "\" & $name
If FileExists($fullName) > 0 Then
MsgBox(0, "Result of FileExist", "File '" & $fullName & "'" & @CRLF & @CRLF & "exist")
Else
MsgBox(48, "Result of FileExist", "File '" & $fullName & "'" & @CRLF & @CRLF & "exist not")
EndIf
EndFunc
; =============================================================================
Attachments (0)
Note:
See TracTickets
for help on using tickets.

Or you could try reading the documentation and applying some critical thinking.