Opened 15 years ago

Closed 15 years ago

#833 closed Bug (No Bug)

Bug in function DllOpen ()

Reported by: fristo Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


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:
 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)
	ExistDLL ($nameDll)

	$Netapi = DllOpen($nameDll)
	MsgBox(48, "@ERROR Of DllOpen", "Call DllOpen (" & $nameDll & ")" & @CRLF & @CRLF & "@error = " & @error)
	ExistDLL ($nameDll)
; =============================================================================	

Func ExistDLL ($name)	
	Local $fullName = @SystemDir & "\" & $name
	If FileExists($fullName) > 0 Then
		MsgBox(0, "Result of FileExist", "File '" & $fullName & "'" & @CRLF & @CRLF & "exist")
		MsgBox(48, "Result of FileExist", "File '" & $fullName & "'" & @CRLF & @CRLF & "exist not")
; =============================================================================	

Attachments (0)

Change History (1)

comment:1 Changed 15 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.