?
Solved

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

Posted on 2009-07-08
10
Medium Priority
?
1,075 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 5

Expert Comment

by:BrianVSoft
ID: 24813194
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 2000 total points
ID: 24813458
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
ID: 24814329
I forgot to mention the OS I am using is windows XP Pro SP2.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:bitoboy
ID: 24815430
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
ID: 24825249
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
 

Author Comment

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

Expert Comment

by:Antagony1960
ID: 24825737
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
ID: 24825784
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
ID: 24825836
Thanks for the points and the grade. I just wish I could have offered you a definitive solution.
0
 

Author Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

765 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