Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / October 2004

Tip: Looking for answers? Try searching our database.

public variable inside of a class was lost at runtime

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnL - 22 Oct 2004 17:06 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.