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.
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
Rate Determine IDE/Debugging Status
(3(3 Vote))
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
Determine IDE/Debugging Status Comments
No comments yet — be the first to post one!
Post a Comment