Search Tools Links Login

Determine IDE/Debugging Status


This function will return whether you are running your program or DLL from within the IDE, or compiled. I use it as part of my DLL's like active document DLL's to setup information that would normally be supplied from the outside.

Original Author: L. F. Carpenter

Returns

Returns True if you are running inside the VB 5.0 or 6.0 IDE.

API Declarations

Private Declare Function GetModuleFileName Lib "kernel32" _
Alias "GetModuleFileNameA" _
( _
ByVal hModule As Long, _
ByVal lpFileName As String, _
ByVal nSize As Long _
) As Long

Code


Public Function InVBDesignEnvironment() As Boolean

Dim strFileName As String
Dim lngCount As Long

strFileName = String(255, 0)
lngCount = GetModuleFileName(App.hInstance, strFileName, 255)
strFileName = Left(strFileName, lngCount)

InVBDesignEnvironment = False
If UCase(Right(strFileName, 7)) = "VB5.EXE" Then
  InVBDesignEnvironment = True
ElseIf UCase(Right(strFileName, 7)) = "VB6.EXE" Then
  InVBDesignEnvironment = True
End If
End Function

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 96 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.