Solved

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

Posted on 2009-07-08
10
1,048 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 500 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

690 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