Solved

how dll detect whether i run in runtime or ide

Posted on 2000-04-12
4
230 Views
Last Modified: 2010-05-02
i have a dll which i've with visual basic and i've make other project that call this dll...

all i want is, the dll which i've called can differenciate whether i running my project in ide or in runtime?
0
Comment
Question by:cindafuzzy
  • 2
4 Comments
 
LVL 28

Expert Comment

by:Ark
ID: 2707137
Public Function IsIDE() As Boolean
    On Error GoTo ErrHandler
    'because debug statements are ignored when
    'the app is compiled, the next statment will
    'never be executed in the EXE.
    Debug.Print 1 / 0
    IsIDE = False
Exit Function
ErrHandler:
    'If we get an error then we are
    'running in IDE / Debug mode
    IsIDE = True
End Function
Cheers
0
 

Author Comment

by:cindafuzzy
ID: 2708390
Adjusted points from 150 to 200
0
 

Author Comment

by:cindafuzzy
ID: 2708391
ok... it is orait then to detect whether the program is running in ide or not

but may be i should clearify it...

i have made the dll using visual basic, the main objective of the dll is to detect whether the program calling him is running in ide or not.
0
 
LVL 6

Accepted Solution

by:
DrDelphi earned 200 total points
ID: 2708483
This will show if VB is running.


Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Sub Command1_Click()
If VBRunning Then
 MsgBox ("yes")
Else
MsgBox ("Nope")
End If
End Sub

Function VBRunning() As Boolean
If FindWindow("IDEOwner", "") = 0 Then
 VBRunning = True
Else
VBRunning = False
End If
End Function





Good luck!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access - Capture pressed key onclick 4 43
using Access 8 84
Hide vba in gp 7 115
Win 10 Automation Error with .doCmd in Access 2 27
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question