I'm trying to use serialport.h MFC wrapper to send data to COM1. Where do I put the
port.Open(bla bla bla)
to ensure that the port is opened the instant the program is initiated, and only closes when the program exits? At the moment I'm stuck trying to figure out the scopes of each function. If I put the declaration in the message handler it works fine but i dont want the added time taken to open the port and close it again every time, plus I may have a different thread recieving at the same time or very shortly after. Where ever I put it it either throws compile-time errors about 'port' not existing or it closes it immediately after sending. Its simple in proceedural - you just lob the open in at the top and the close at the end, in a GUI i'm stuck
I'd post the full code but I think people would get mad - its a long program.
0 · ·