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)

Change History (1)

comment:1 by Valik, 17 years ago

Resolution: No Bug
Status: newclosed

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

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.