> 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.) Whenever I've got weirdness like that I suspect dll issues. An easy way to debug that is to use a tool like filemon, it'll list every file that your app tries to access. Compare a run with the VB environment versus a run standalone, you will probably see a different DLL being called. TTYL -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu