Make your own free website on Tripod.com

Visual Basic Tutorial Part 6

myitcareer.org-Your IT Career Partner For Life. Please Bookmark It.
Homework Help | Buy Book | Buy Phone | Top Web Hosts | Hire Web Designer
Home | Interview Questions And Answers | Hosting Charges | Online Tuition
Top Domain Registrars | Hire Freelancer | Employee Provident Fund | Hindi News

Click Switch To, to bring TestForm to the front.

Note Depending on your system configuration and the
order in which programs are loaded, the copy of Visual
Basic in which Coffee is running may come to the front
along with TestForm, obscuring CoffeeWatch.
5.
Click on CoffeeWatch again, to bring it to the
front and display the Component Request Pending dialog
box again.
Note If you can't see CoffeeWatch (the form, not the
project), use the task bar (or press ALT+TAB) to bring
it to the front.
In the strict sense of the word, TestForm is modal to
CoffeeWatch. That is, you can't do anything with
CoffeeWatch until TestForm is dismissed. However,
because the two forms are in different processes,
CoffeeWatch can appear on top of TestForm.
6.
Click Switch To, to bring TestForm to the front,
and then click TestForm's close box to dismiss the
modal form.
7.
Click Show Modeless Form to show TestForm as a
modeless form.
TestForm behaves like a modeless form that's not owned
by CoffeeWatch. That is, it doesn't stay on top of
CoffeeWatch. You can verify this by clicking on each
of the two forms, to bring them alternately to the
front.
Important Because TestForm is in a different process
from CoffeeWatch, you cannot make CoffeeWatch the
owner of TestForm as you would if the forms were in
the same process -- that is, by passing a reference to
CoffeeWatch in the OwnerForm argument of TestForm. For
details see "Displaying Forms from Code Components,"
in Chapter 8, "Building Code Components."For details
see "Displaying Forms from Code Components," in
"Building Code Components."
8.
DO NOT dismiss the modeless TestForm. Instead,
close CoffeeWatch by clicking its close box.
TestForm doesn't close. (It may be hidden behind the
instance of Visual Basic containing the CoffeeWatch
project -- use the task bar or ALT+TAB to bring it to
the front.)
This illustrates two important points: First, a form
displayed by an out-of-process component is not


dependent on the client application. Nor is its
lifetime limited by the client's lifetime.
Second, a loaded form can keep an out-of-process
component's executable from unloading. For details,
see "Starting and Ending a Component" in Chapter 6,
"General Principles of Component Design."For details,
see "Starting and Ending a Component" in "General
Principles of Component Design."
In its Terminate event, CoffeeMonitor should unload
any forms it has shown.
9.
Dismiss TestForm by clicking its close box. The
Coffee component remains in run mode. To return Coffee
to design mode, click the End button, or select End
from the Run menu.
Once you put an ActiveX EXE project in run mode, it
remains in run mode. This is convenient for testing,
but it's different from the behavior of the made .exe.
The executable for an out-of-process component unloads
when the last client releases its last reference to an
object provided by the component, as discussed in
"Starting and Ending a Component."
Note The only way to test the shutdown behavior of
an out-of-process component is to test with the made
executable.
The lesson to take away from all this is that
out-of-process code components are generally not the
best way to show forms.
Step by Step
This topic is part of a series that walks you through
creating a sample ActiveX EXE.
To
See
Go to the next step
Providing an Asynchronous
Notification Event
Start from the beginning
Creating an ActiveX EXE
Component



Send feedback to MSDN. Look here for MSDN Online
resources.




37. What are the different cursor types that can we
create using ADO Recordset?
Difference between these cursor types?
Visual Basic Concepts
ADO, DAO and RDO in Visual Basic

In Visual Basic, three data access interfaces are
available to you: ActiveX Data Objects (ADO), Remote
Data Objects (RDO), and Data Access Objects (DAO). A
data access interface is an object model that
represents various facets of accessing data. Using
Visual Basic, you can programmatically control the
connection, statement builders, and returned data for

Next topic
Previous topic