Results 1 to 2 of 2

Thread: Determine if running within IDE using code?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Arrow

    Hello everyone. Hey, is there anyway to determine, using code, whether I'm running within the IDE or not? Thanks for listening.
    Micah Carrick
    Visual Basic 6 SP5
    Visual Basic.NET
    Quixotix Software
    [email protected]
    Download QCM 1.0 - Intelligent ActiveX Control Management

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Code:
    Option Explicit
    
    ' Flag for debug mode
    Private mbDebugMode As Boolean
    
    
    ' Set mbDebugMode to true. This happens only
    ' if the Debug.Assert call happens. It only
    ' happens in the IDE.
    Private Function InDebugMode() As Boolean
        mbDebugMode = True
        InDebugMode = True
    End Function
    ' Set the mbDebugMode flag.
    Private Function InIDE()
        ' This will only be done if in the IDE
        Debug.Assert InDebugMode
        If mbDebugMode Then
            InIDE = True
        End If
    End Function
    Private Sub Form_Load()
        ' See if we are running in the IDE.
        
        If InIDE Then
            MsgBox "In the development environment"
        Else
            MsgBox "In a compiled executable"
        End If
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width