Solved

Terminate ActiveX DLL

Posted on 2001-09-10
7
842 Views
Last Modified: 2008-03-10
the function for terminate EXE application is "END"
using this in ActiveX dll I receive the message:
     ?Compile error: Functionality not supported in DLL?
is there another way to do it?
0
Comment
Question by:danyb
  • 5
  • 2
7 Comments
 
LVL 39

Expert Comment

by:appari
ID: 6469937
setting the object variable to nothing will terminate the activex.

Dim acApp As Access.Application
Set acApp = New Access.Application
Set acApp = Nothing

0
 

Author Comment

by:danyb
ID: 6469949
my activeX application contain a FORM.
i'm openning the "from" from it.
i want to close the application from the "form".
how can i do it?
0
 
LVL 39

Expert Comment

by:appari
ID: 6469960
can you post code how you are creating the object and how you are showing the form inside dll?

0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 39

Expert Comment

by:appari
ID: 6469964
>>i want to close the application from the "form".
does this mean you want to close calling application?
0
 

Author Comment

by:danyb
ID: 6469979
' activeX dll
-------------------------------------------------------
Implements ICommand
Implements ICreateCommand

Private Sub ICommand_Execute()
    ' Load the Tree form as MODAL
    Tools.Show vbModal
End Sub
------------------------------------------------------
if the form i'm using some other references.
and in the form i'm trying to close the application but...
0
 
LVL 39

Expert Comment

by:appari
ID: 6470020
this is being a dll you cannot use End statement . insted just Unload the form tolls.

and see the topic "Visual Basic Component Shutdown Rules." in MSDN for the rules to follow.

components will be released automatically when they are out of scope.
0
 
LVL 39

Accepted Solution

by:
appari earned 100 total points
ID: 6470023
Summary of Guidelines for Component Shutdown
The following guidelines summarize what you need to remember about component shutdown.

A well-behaved component does not control its own lifetime.


Don?t shut an out-of-process component down forcibly using the End statement.
As a corollary to this, don?t implement a Quit method. Releasing a component by releasing all references to its objects is good programming practice. Educate users of your component by explaining in your Help file that this is the correct way to release your component. Don?t encourage bad programming practices by giving developers a shortcut that could disrupt other clients.

Don?t prolong the life of your component needlessly by keeping a form loaded but hidden when there are no objects using it.


Avoid circular references that artificially prolong the life of your component, such as an object that holds a reference to a form that in turn holds a reference to the object. Circular references are discussed in "Dealing with Circular References," in "General Principles of Component Design."


If your component is a standalone desktop application that also provides objects, remember that the computer user is one of your clients.
Most of the work of being a good component is done for you by Visual Basic. You can go a long way by simply letting it do its job.


--------------------------------------------------------------------------------
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

825 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