473,471 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Application.Run problem

I posted this accidentally to dotnet.general, but it is a VB.NET problem, so
here it is again ...

With VB.NET in VS 2003 I am using "Sub Main()" as my startup object, and
from within Sub Main() I use "Application.Run(MyMainForm)". Essentially I am
starting my application and then displaying the form, rather than setting
the form as the startup object. This works great except for one major
problem ... I can't access any of the form's controls while in the debugger.
There is no problem accessing local variables in a procedure, but when I try
to access a label control on the form my machine hangs.

What causes this problem and how can I get around it?

It is very consistent - I can always display anything I want at a
breakpoint, except controls on the form. If I try to display them in the
immediate window my machine hangs.

Thanks,

Tom
Nov 21 '05 #1
2 1033
not seeing how you are doing this in code makes a definitive answer in
cide, but three things quickly come to mind...
0) there must be an instance of the form created before you can access
the controls
Dim frm as New MyForm()
1) check the access level of the controls and the methods -- VB sets
things as Protected or Friend
2) this is a bug in Whidbey Beta 1 (I see this with other variables as
well -- something with the debugger -- the variables jump out of scope
before they really should -- a workaround solution is to print values to
the debug window)

Cheers.
---
http://code.box.sk
nemo me impune lacessit

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #2
Further testing shows that the problem occurs due to the use of a timer
object in my program. I have the following in my object's constructor:

moAutoResetEvent = New AutoResetEvent(True)

moIntervalStateTimer = New System.Threading.Timer(moTimerDelegate,
moAutoResetEvent, 0, mnScanIntervalMilliseconds)

If I comment out the lines that create the timer then I have no lockup
problems in the debugger. But with the timer included, as long as I don't
use the debugger the timer fires perfectly and everthing is happy.

Any ideas?

Thanks in advance,
Tom

"Tom Edelbrok" <an*******@anonymous.com> wrote in message
news:WHLge.37690$0X6.17226@edtnps90...
I posted this accidentally to dotnet.general, but it is a VB.NET problem,
so here it is again ...

With VB.NET in VS 2003 I am using "Sub Main()" as my startup object, and
from within Sub Main() I use "Application.Run(MyMainForm)". Essentially I
am
starting my application and then displaying the form, rather than setting
the form as the startup object. This works great except for one major
problem ... I can't access any of the form's controls while in the
debugger.
There is no problem accessing local variables in a procedure, but when I
try
to access a label control on the form my machine hangs.

What causes this problem and how can I get around it?

It is very consistent - I can always display anything I want at a
breakpoint, except controls on the form. If I try to display them in the
immediate window my machine hangs.

Thanks,

Tom

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Timothy Shih | last post by:
Hi, I am having a freezing issue with my application. My application serves several remotable objects, all of which must be initialized before their use. Furthermore, some of them depend on each...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
8
by: Pete Wittig | last post by:
Hello, I am wondering if it is possible to create a networked application with C# that is seen as a windows user. For example, if Bob logged onto windows and then started the application, any...
1
by: CES | last post by:
All, Could someone please point me to a step by step resource on setting up a ..net Web Application on IIS. I'm having a problem setting up IIS to except a new Web Application. I'm deploying...
9
by: William LaMartin | last post by:
I have a problem, mentioned here before, of Session and Application variables disappearing at one site but not at others or on my development computer. The problem is illustrated by an example...
5
by: Lars-Erik Aabech | last post by:
Hi! Guess it's my day again.. Tried to deploy a test release of a new asp.net web today, and got a terrible error. The web is running swell on three development computers, but when it's copied...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
13
by: Kevin Liebowicz | last post by:
Yes, I wasted the past two days trying to fix this. Yes, this is on a Win2003 Server. Yes, this machine is a domain controller. Yes, I seen the dozens of KB articles like this one:...
6
by: Tony Johansson | last post by:
Hello! We have a C#.ASP.NET application that runs on a IIS 6. The application contains actually several asp pages but there is no GUI. The application receive an xml file that is processed....
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.