Solved

Terminate ActiveX DLL

Posted on 2001-09-10
7
844 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

717 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