Jump to content
Sign in to follow this  
Unc3nZureD

DllCall error [Unknown]

Recommended Posts

Unc3nZureD

Hi guys. I've got an unknown problem when calling my DLL. So here what I do when it occurs:

- If I choose an au3 and press test it will successfully call the DLL

- If I choose an au3 and and icon and press test button it will fail calling the DLL

Got no idea why. The DLL is attached, here's my code:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("AutoIT", 332, 379, 211, 161)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Group1 = GUICtrlCreateGroup("File ", 8, 40, 313, 137)
$Label2 = GUICtrlCreateLabel("Input:", 16, 67, 31, 17)
$Input1 = GUICtrlCreateInput("", 64, 64, 201, 21)
$Label4 = GUICtrlCreateLabel("Seed:", 16, 139, 32, 17)
$Input3 = GUICtrlCreateInput(Random(100, 999, 1), 64, 136, 145, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Button1 = GUICtrlCreateButton("...", 272, 64, 27, 21)
$Input4 = GUICtrlCreateInput("", 64, 112, 201, 21)
$Label9 = GUICtrlCreateLabel("Icon:", 16, 116, 28, 17)
$Button5 = GUICtrlCreateButton("...", 272, 112, 27, 21)
$Button4 = GUICtrlCreateButton("Test", 128, 344, 75, 25)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button5
$File2 = FileOpenDialog("Choose the Icon", @ScriptDir, "Icons (*.ico)")
GUICtrlSetData($Input4, $File2)
Case $Button1
$File = FileOpenDialog("Choose the File", @ScriptDir, "Sources (*.au3)")
GUICtrlSetData($Input1, $File)
Case $Button4
$read = GuiCtrlRead($Input3)
$seeder = _Call($read)
MsgBox(0,"", "DONE!")
EndSwitch
WEnd

Func _Call($addseed)
$xxcount = Int($addseed/100)
MsgBox(0,"",$addseed & @CRLF & $xxcount)
$keys = DllCall("Project21.dll", "int", "AddIntegers", "int", $addseed, "int", $xxcount)
Return $keys[0]
EndFunc

Project21.rar

Share this post


Link to post
Share on other sites
trancexx

Check your gay entry point function.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Unc3nZureD

But it works If I don't choose the icons button. If I just press the icon button (even if I don't choose anything) It crashes. Does the same happen at you guys?

Share this post


Link to post
Share on other sites
trancexx

It doesn't matter when it works and when not, if it's broken.

It may work if you DllOpen() at the top of the script and pass dll handle to DllCall(), but that doesn't mean that's ok.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Unc3nZureD

Thanks, it works. I just had to open it before using :)

Share this post


Link to post
Share on other sites
trancexx

Indeed.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×