On Mon, 4 Aug 2003 13:30:46 -0400, Greg Miller wrote: >On Sun, 3 Aug 2003 23:15:46 -0700 Bob Barr wrote: > >>Specifically, the CreateFile call to access my USB device fails and >>returns an error. The error code translates to "Invalid access to >>memory location." > > I seriously doubt CreateFile is behaving differently, it's more likley you're not > passing in the same parameters in each case. You might also try > adding some DoEvents calls before and after the CreateFile call. Thanks for your reply, Greg. I can run the program successfully from within Visual Basic. Making absolutely no changes to the source code, I hit "File > Make myprog.exe". When I exit Visual Basic and double click on the EXE file to execute it, it fails on the CreateFile call. Unless the parameters to CreateFile are somehow being passed differently by the same source code, CreateFile is definitely behaving differently. While I doubt that it will make any difference, I'll try adding a few DoEvents calls before and after the CreateFile call. (I'll really be scratching my head if that fixes it.) Regards, Bob -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu