>> question 1 - the parameter 'commport' - what form should it take? It seems to want the form 'COM3' . Is that right?
>
>Yes, that's the form
>
It's platform-dependent (you may have to add or remove the trailing ":"; I don't know which platform he's on) and it has to be a valid, defined port - IOW, if you point at COM3: and there is no COM3: defined to the operating system, you're toast.
>> lnport = CreateFile(CommPort, GENERIC_READ + GENERIC_WRITE, 0, 0, 3, 0, 0)
>
>-1 is INVALID_HANDLE_VALUE. The reason I suspect that you're getting this is that, in my haste, I neglected to add the @ sign to the CommPort parameter. Try:
>
>lnport = CreateFile(@CommPort, GENERIC_READ + GENERIC_WRITE, 0, 0, 3, 0, 0)
>
George, it shouldn't matter if you pass by val or by ref in the call - it expects to get an LPCTSTR, so if you've defined it as STRING @ in the DECLARE, it should be fine; nothing comes back in the parameter.