Solved

how dll detect whether i run in runtime or ide

Posted on 2000-04-12
4
201 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 27

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code 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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now