Prev: Printing the Form
Next: Common Controls 5.0 / Windows 7
From: Tony Toews [MVP] on 10 Nov 2009 21:12 "Tony Toews [MVP]" <ttoews(a)telusplanet.net> wrote: >No matter if I download a genuine file or not, from a valid domain >name, I always get So I made an exe and ran the code in a Windows XP virtual system and it worked as expected. I saw the code 200 and 404 as expected. However I still didn't need to Start Sock. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a free, convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/
From: Tony Toews [MVP] on 10 Nov 2009 23:15 "mayayana" <mayaXXyana(a)rcXXn.com> wrote: >A successful server interaction but with an >error when it finishes. That sounds like it might be the problem. When I poked about in the MouseUp routine I commented out the RaiseEvent -1 line and replaced it with the line in the else condition. DisConnect If (LNum = -1) Then ' RaiseEvent OnDownloadFinish(-1, CStr(Err.LastDllError)) RaiseEvent OnDownloadFinish(LServerCode, sServerCode) Else RaiseEvent OnDownloadFinish(LServerCode, sServerCode) End If I got the expected results. 200 and 404 as appropriate for file found and not found. So I'm going to think about this a bit. There sure appears to be something "special" about my system. And I hate being "special" <sigh> Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a free, convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/
From: Tony Toews [MVP] on 11 Nov 2009 00:52 "mayayana" <mayaXXyana(a)rcXXn.com> wrote: > Have I got that right? Another thought I had: It sounds >like you're doing GETs, but if you're doing HEAD that might >make a difference. The T1_MouseUp sub in the UC is where >the data gets received. It keeps receiving until it gets a >0 (no more data) or -1 (error from WReceive). What you see >in the program window is the return from OnDownloadFinish, >either the server code or -1, depending on the call to WReceive. Been playing around with this trying to figure out why my system is so special. One clue is that I inserted the following debug line Case FD_READ '-- &H1 - read buffer is ready. Get <= 8 KB. ReDim ABuf(0 To 8191) As Byte LNum = WReceive(HSock, ABuf(0), LEN8192, 0&) Debug.Print "LNum: " & LNum When I download a 64 kb file I get the following LNum: 8192 LNum: 8192 LNum: 8192 LNum: 8192 LNum: 8192 LNum: 8192 LNum: 8192 LNum: 7563 LNum: 0 LNum: -1 LNum: -1 LNum: -1 LNum: -1 LNum: -1 LNum: -1 LNum: -1 When I download a 106 Kb file I get 6 or so more of the LNum: 8192 lines and 6 or so more of the Lnum -1 lines. So I don't know why the T1_MouseUp routine is being called again like that resulting in multiple -1 entries on LNum. Still digging a bit. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a free, convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/
From: Tony Toews [MVP] on 11 Nov 2009 01:16 "mayayana" <mayaXXyana(a)rcXXn.com> wrote: >Each time I got a 404 as expected. I don't know what >might be different between our two systems or >connections, and I've never heard of anyone running >into that problem before. I have TCP/IP V6 also enabled in Win XP. Maybe that's a difference. Given that this control has something to do with a Mouse maybe it's because it's a laptop with a Mouse pad and an external USB mouse. I unplugged the USB mouse but that didn't make a difference. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a free, convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/
From: Nobody on 11 Nov 2009 01:18
"Tony Toews [MVP]" <ttoews(a)telusplanet.net> wrote in message news:d87kf5l851h3gk602mfl6it06svu8bv6c2(a)4ax.com... > However I still didn't need to Start Sock. You must. Maybe the OS you are using is forgiving, but it may not work in other OS'es or service packs. Quote from the first paragraph of WSAStartup's remarks section: "The WSAStartup function must be the first Windows Sockets function called by an application or DLL. It allows an application or DLL to specify the version of Windows Sockets required and retrieve details of the specific Windows Sockets implementation. The application or DLL can only issue further Windows Sockets functions after successfully calling WSAStartup." If you don't call it, you would normally get WSANOTINITIALISED, but it seems that the OS that you are using calls it for you, but this may not happen in the future. |