I am using the API calls to ReadFile and WriteFile to access data coming in on serial ports and sending commands out to devices on Serial ports.
Everything works fine in the VB6 developer.
When I compile the programme I can compile to P-Code and everything works fine.
If I compile to Native Code with no optimisation the Read part works OK but the Write Section terminates the application with no error trapping functioning working. It just bombs out.
If I compile to Native Code and apply opptimisation for small code then neither the Read nor the Write works.
I cannot work out what is going on. I am not changing the code in any way, merely compiling with different options.
Please can anyone help to explain why this should happen. ( I have been pulling my hair out over it for several days now !)
Thanks in advance