Jump to content

Recommended Posts

Posted

Hi, am using the following script which is getting a file via ftp from a SCO Unix box

#include <FTP.au3>


$server = "10.0.0.99"
$username = "user"
$pass = "pass"

$srcPath = "/v1/backup/"
$filename =  "myfile.txt"

_myGetFile()
MsgBox(16,"Result",$result)


Func _myGetFile()
    $dllhandle = DllOpen('wininet.dll')
    $Open = _FTPOpen('MyFTPControl2')
    $Conn = _FTPConnect($Open, $server, $username, $pass,0)
    $Ftpp = _FtpGetFile($Conn, $srcPath & $filename, @ScriptDir & '\' & $filename,1,0)
    $Ftpc = _FTPClose($Open)
    DllClose($dllhandle)
EndFunc


;From  Wouter van Kesteren
Func _FTPGetFile($l_FTPSession, $s_RemoteFile, $s_LocalFile, $l_Flags = 0, $l_Context = 0)
    Local $ai_FTPGetFile = DllCall('wininet.dll', 'int', 'FtpGetFile', 'long', $l_FTPSession, 'str', $s_RemoteFile, 'str', $s_LocalFile, 'long', $l_Flags, 'long', $l_Context)
    If @error Or $ai_FTPGetFile[0] = 0 Then
        SetError(-1)
        Return 0
    EndIf
    Return $ai_FTPGetFile[0]
EndFunc  ;==>_FTPGetFile

File is downloading ok but the compiled version is throwing an "AutoIt Error" msgbox that says that "Error: AutoIt has detected the stack has become corrupt". Also the tray icon is not exiting/refreshing and any furthur commands like msgbox is not displaying after the function completes?

I have tried changing the default Return type in the dllcall as advised in the help file (cdecl) this didnt work

Anyone have any ideas on this?

Thanks

Posted

Hi, am using the following script which is getting a file via ftp from a SCO Unix box

#include <FTP.au3>
$server = "10.0.0.99"
$username = "user"
$pass = "pass"

$srcPath = "/v1/backup/"
$filename =  "myfile.txt"

_myGetFile()
MsgBox(16,"Result",$result)
Func _myGetFile()
    $dllhandle = DllOpen('wininet.dll')
    $Open = _FTPOpen('MyFTPControl2')
    $Conn = _FTPConnect($Open, $server, $username, $pass,0)
    $Ftpp = _FtpGetFile($Conn, $srcPath & $filename, @ScriptDir & '\' & $filename,1,0)
    $Ftpc = _FTPClose($Open)
    DllClose($dllhandle)
EndFunc
;From  Wouter van Kesteren
Func _FTPGetFile($l_FTPSession, $s_RemoteFile, $s_LocalFile, $l_Flags = 0, $l_Context = 0)
    Local $ai_FTPGetFile = DllCall('wininet.dll', 'int', 'FtpGetFile', 'long', $l_FTPSession, 'str', $s_RemoteFile, 'str', $s_LocalFile, 'long', $l_Flags, 'long', $l_Context)
    If @error Or $ai_FTPGetFile[0] = 0 Then
        SetError(-1)
        Return 0
    EndIf
    Return $ai_FTPGetFile[0]
EndFunc ;==>_FTPGetFile

File is downloading ok but the compiled version is throwing an "AutoIt Error" msgbox that says that "Error: AutoIt has detected the stack has become corrupt". Also the tray icon is not exiting/refreshing and any furthur commands like msgbox is not displaying after the function completes?

I have tried changing the default Return type in the dllcall as advised in the help file (cdecl) this didnt work

Anyone have any ideas on this?

Thanks

I don't see anything wrong with your code. Have you tried compiling what you've posted and seeing if that runs ok? Since you haven't posted all the code you are compiling the error could be in some other part of your script.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

I don't see anything wrong with your code. Have you tried compiling what you've posted and seeing if that runs ok? Since you haven't posted all the code you are compiling the error could be in some other part of your script.

Hi, the only bit i left out (or changed) was

$result = _myGetFile()

(instead of)

_myGetFile()

Thanks for taking a look

So just to clarify

1. The above file is being downloaded

2. When debugging i dont get any errors in Scite (latest AutoIt and Scite), but my msgbox doesnt display and the tray icon doesnt disappear though the degub app has exited (mousing over tray icon disappears it though (refresh problem?)

3. When compiled the file also is downloaded but i get the 'stack error' as mentioned and again no msgbox after the function (_myGetFile) runs

Thanks

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...