I am using Visual Studio 6.0 to develop a Win32 application for serial
communication.
I defined a public HANDLE variable for the communications device in my
serial communication class SCOMM. I debug the software and to my surprise,
sometimes this variable could not keep its value during the class life span,
and it changed its value to a different one. After I defined this HANDLE
variable to a global variable, this problem did not happen any more. I am
sure that the HANDLE variable was not defined somewhere else. Could anybody
help?
Thanks.
John
Victor Bazarov - 22 Oct 2004 17:25 GMT
> I am using Visual Studio 6.0 to develop a Win32 application for serial
> communication.
[quoted text clipped - 6 lines]
> sure that the HANDLE variable was not defined somewhere else. Could anybody
> help?
You probably have a serious buffer overrun problem that causes the
instance of your class to be affected. Set the debugger to break at
the time of the member variable changing, and run your program. It
will be slow as hell but it will stop when the overrun occurs. Of
course you could try to analyse the hell out of your code attempting
to find it without running. It's hard, though.
V
JohnL - 25 Oct 2004 18:00 GMT
Thanks for your advice.
John
> > I am using Visual Studio 6.0 to develop a Win32 application for serial
> > communication.
[quoted text clipped - 15 lines]
>
> V