Advertisement

12.13.2006 at 06:36AM PST, ID: 22091858
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Testing if executing code is in IDE

Asked by dbbishop in Visual Basic Programming

Tags:

I asked a question a while back that came up with the following solution of testing if I am running in the IDE. My solution was the following code. The variable IS_IN_IDE is declared Public in a module. The method SetServerValues is executed from the startup method in the application (Sub Main()) before any forms are loaded. In the Load event of the MDI parent I have the code frmHREmployeeInformation.lblTest.Visible = IS_IN_IDE. This is the ONLY place I set the visible property of this label. The label has the caption, "Running in IDE with Test Database"

The problem is that the label is being displayed on certain user's systems when running the compiled application. Can anyone give me a clue as to why this is happening? I have also determined that only the display of the label is being affected. In other words, in the If statement within SetServerValues() below, I set up variables to either point database access to test or production databases. If the compiled code is being run, I use production databases, even though the label is displayed that indicates I am in a test environment. There is NO POSSIBLE WAY the user could be running uncompiled code. They do not have VB installed on their machine.


==========================================
Public Sub SetServerValues()
    If IsInIDE Then
        ...
        IS_IN_IDE = True
    Else
        ...
        IS_IN_IDE = False
    End If
End Sub

Private Function IsInIDE() As Boolean
   Dim X As Long
   
   X = 0
   Debug.Assert Not TestIDE(X)
   IsInIDE = (X = 1)
End Function

Private Function TestIDE(X As Long) As Boolean
   X = 1
End Function

==============================================Start Free Trial
[+][-]12.13.2006 at 06:44AM PST, ID: 18130768

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.13.2006 at 06:46AM PST, ID: 18130775

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.13.2006 at 06:53AM PST, ID: 18130834

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: from
Sign Up Now!
Solution Provided By: weiroblpay
Participating Experts: 3
Solution Grade: B
 
 
[+][-]12.13.2006 at 08:32AM PST, ID: 18131822

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32