| Dart Home | PowerTCP FTP for ActiveX | Custom Development | Reply | PowerTCP FTP for ActiveX Topics | Forums |
| Author | Forum: PowerTCP FTP for ActiveX Topic: VB6 Visual Studio crashes when running FTP client |
| roofrack gary.roussak@tyrrellsystems.com From: Leigh, United Kingdom Posts: 23 Member Since: 06/08/06 |
posted October 26, 2006 4:09 PM I appear to have discovered an issue with the FTP Tool - but only when running from Visual Studio rather than running a standalone EXE (so it could be an issue with Visual Studio !). To explain: I have an FTP server, written using the Dart FTPServer Tool, and an FTP Client written using the Dart FTP Tool. The server code implements an extended command (which I call "CSBZ", but thats not important) which, when received, does some simple file processing on the server for a second or two, then sets Response.Status = 250 and Response.StatusText = "Command completed". No other data is returned to the client. The client simply logs into that server with username and password then, when password is accepted, issues the CSBZ command. All this is done with Timeout=0 and using event handling. Note that, because they are unfinished, I am still testing server and client by running them in two separate instances of Visual Studio (on the same Windows XP SP2 system). The server is fine - no problems whether it runs from Visual Studio or as an EXE. The client is fine if it runs as an EXE. It receives the 250 from the server and carries on. However, if the client is run from Visual Studio, VS crashes at the point where the client should receive the 250 - but the Progress event never gets fired. The error returned is from VB6.EXE, the module concerned is OLEAUT32.DLL (ver 5.1.2600.2180), and always at the same offset (4874). The error code is C0000005 (i.e. access violation - when was it ever anything else !!). I could send the code, but there is a lot of irrelevant stuff in the server which I would have to strip out. Obviously this is a real pain. Not being able to test and debug in VS is hampering development. Any ideas ? Thanks |
| roofrack gary.roussak@tyrrellsystems.com From: Leigh, United Kingdom Posts: 23 Member Since: 06/08/06 |
posted October 27, 2006 7:23 AM Oh dear - a reply to my own original post.... To anyone concerned - I have solved this problem. As often happens, it was down to the developer! I hadn't fully read the reference docs for the FTP.Command method which states quite clearly: "The Result parameter is used to capture the reply, so it must not go out of scope while the command completes (it must have file or global scope)." Needless to say, I had declared my Result parameter *inside* the Progress event, instead of publicly at the form level. Correcting this solved the problem. All I would say is this. Would you expect declaring a variable at an inappropriate level to crash the IDE completely? Or is VB6.EXE that poor? OK, maybe don't answer that last one.... So beware - no amount of error trapping will stop this one. It lost me about 4 hours development time when I could least afford it! |
| Amit From: Rome, NY USA Posts: 315 Member Since: 03/15/06 |
posted October 27, 2006 10:00 AM Hello, You are absolutely right that the Result Parameter is used to capture the reply, so it must not go out of scope while the command completes (it must have file or global scope). If you specify this parameter inside the Progress Event, then it does not have any file or global scope. So when this parameter goes out of scope you might see some undesired behavior (if it does not have file or global scope). Regards, Amit |
| roofrack gary.roussak@tyrrellsystems.com From: Leigh, United Kingdom Posts: 23 Member Since: 06/08/06 |
posted October 27, 2006 10:41 AM Amit, I understand what you mean about "undesirable behaviour", and I certainly wouldn't have moaned to get an unexpected null string or even a run-time error occur - but it seems rather poor that the VB6 IDE actually dies. Just my opinion. |
| Reply | PowerTCP FTP for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|