Solved

CTRL+Break does not stop code on message box in VB6

Posted on 2009-07-08
10
968 Views
Last Modified: 2012-05-07
I've been programming in VB6 for years...but I switched to a Latitude D620 laptop. Now for some reason when I'm programming in the VB6 IDE, have a message box appear, then press CTRL+BREAK on my keyboard, the message box disappears but the code does not break in VB6 like it used to.

I tried the Microsoft on-screen keyboard (command line = 'osk'), but it had the same affect.

HELP!!!
0
Comment
Question by:bitoboy
  • 5
  • 4
10 Comments
 
LVL 5

Expert Comment

by:BrianVSoft
Comment Utility
VB has never handled stepping and 'Ctrl+Break' well when a modal was involved..
(and Message box modals are one of the worst offenders)
Over 10 years and many PCs, I have seen dozens of truly weird situations.
I don't think there is anything particular about the DELL D620 model, it is more likely specific to your machine. I don't think there is a "solution" to your problem..
It might help to mention what OS you are running.. (Vista and VB6 don't get along too well)
0
 
LVL 11

Accepted Solution

by:
Antagony1960 earned 500 total points
Comment Utility
I noticed the exact same problem when I updated my old laptop to XP (from W2K) so I think it's probably OS related. I've since run VB6 successfully on several XP and Vista machines and none of them operated a break properly from modal objects.

To get around this problem I created a global constant (bcStopsEnabled), which I set to True when I might need the break. Then I put conditional stops after critical message boxes etc. (If bcStopsEnabled Then Stop). In some larger apps I also have a function which returns True if the app is running in the IDE and I use that to set a global variable (bIDERun) which can be added to the condition to ensure that stops will not be encountered in the compiled app. (If bcStopsEnabled And bIDERun Then Stop). Let me know if you want the function, bitoboy. It's only small but it uses a couple of API functions.
0
 

Author Comment

by:bitoboy
Comment Utility
I forgot to mention the OS I am using is windows XP Pro SP2.
0
 

Author Comment

by:bitoboy
Comment Utility
Also, I have not changed OS's...been using XP Pro the whole time...it seems like there must be an explanation why this particular computer with it's software is causing the problem.
0
 
LVL 11

Expert Comment

by:Antagony1960
Comment Utility
bitoboy, I think it could be something to do with keyboard configuration. After playing around with the on-screen-keyboard (Start|Run|osk), I've discovered that Ctrl+Shift+Break breaks to the IDE as you'd like but Ctrl+Break just closed the message box and continues execution. Although I only have a Vista PC to try it on at the moment as I've left my old XP laptop back at the office.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:bitoboy
Comment Utility
Sadly, CTRL+SHIFT+Break doesn't work, either with the keyboard or OSK. Thx.
0
 
LVL 11

Expert Comment

by:Antagony1960
Comment Utility
Hmm... I don't know what else to suggest then. I've played around with it a bit more on my Vista PC and it seems to be completely erratic as to what action will occur after Ctrl+Break closes a message box. This seems to indicate a timing issue and leads me to wonder whether there is a compatibility problem between the VB6 IDE, modern keyboard hardware and/or the modern OS handling thereof.

A quick Google search has revealed that this problem has been around for years and no easy solution is available... sorry.
0
 

Author Comment

by:bitoboy
Comment Utility
Well bugger...OK I guess I have to give up and get clever with the breaks and stops.
0
 
LVL 11

Expert Comment

by:Antagony1960
Comment Utility
Thanks for the points and the grade. I just wish I could have offered you a definitive solution.
0
 

Author Comment

by:bitoboy
Comment Utility
That's what I get for using a 10 year old programming environment!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now