VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Determine IDE/Debugging Status

by L. F. Carpenter (2 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

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.

Code 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


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

Download this snippet    Add to My Saved Code

Determine IDE/Debugging Status Comments

No comments have been posted about Determine IDE/Debugging Status. Why not be the first to post a comment about Determine IDE/Debugging Status.

Post your comment

Subject:
Message:
0/1000 characters