PRG 240 - Class #13 Lecture
Quiz on Ch. 6 concepts (classes)
Finish Ch. 8 Lecture & Discussion
- Component Object Model (COM)
- ActiveX Dll
- runs in the memory space of the consumer application; this is called
in-process
- ActiveX Exe
- runs in its own memory space; this is called out-of-process
- Testing Components (p. 362)
- For ActiveX Dll's (in-process), you must use the Project Group feature
of VB
- For ActiveX Exe's (out-of-process), you must open two instances of VB
where the Exe project is opened with one copy of VB and the client application
is opened in the other.
- Registering components
- Each component is assigned a unique GUID (globally unique indentifier)
which is kept track by the Windows Registry
- You can use VB to register an ActiveX Dll on your computer. To register
a Dll on a different computer, you can use C:\Windows\System\Regsvr32.exe
with the DOS command
REGSVR32 C:\MyProjectFolder\MyComponent.dll
- ActiveX Exe components are automatically registered on a PC on which
they are compiled.
- Create an ActiveX Dll
- Follow the steps on pp. 364-370 to create and test Ch08ActiveX.dll
- Create an ActiveX Exe
- Follow the steps on pp. 372-374 to create and test Ch08ActiveX.exe
- Code is available to copy and paste for:
- Ch08ActiveXExeClient
- Ch08ActiveXExeServer
- (if time) As a class, do Programming Exercise 8.1 on p. 392 by creating
an ActiveX Dll that computes simple annual interest.
Ch. 9 Lecture & Discussion
- Besides Dll's & Exe's, there is another type of ActiveX COM component
called an ActiveX document.
- An ActiveX document must execute within a container such as an Internet
Explorer browser. It can run in-process (Dll) or out-of-process (Exe). An
ActiveX document within a VB project is actually a UserDocument object.
- UserDocument objects look like and share some similarities with forms. However,
a UserDocument does not have Activate or Load events. Rather, a UserDocument
does have events such as InitProperties, ReadProperties, and WriteProperties
in addition to Initialize.
- A HyperLink object can be used in conjunction with a UserDocument to allow
someone to link to a Web site. Use the NavigateTo method of a HyperLink object
such as:
HyperLink.NavigateTo "http://www.minich.com"
- You can use the MenuEditor to create a menu for a UserDocument although
its menu must merge with the menu of its container.
- A UserDocument object is actually stored in a file with a .dob extension.
When a project is compiled as a Dll or Exe, it is stored as a file with a
.vbd extension.
- Preview the ActiveXUserDocuments.dll exercise from the Student CD-ROM.
- Follow the steps on pp. 398 - 409 to create your own ActiveXUserDocuments.dll
Review Ch. 5 VB Auto Center specs & spend the remaining time working on
that assignment.
Homework Assignment:
- Review any notes and/or activities in the above lecture that were not covered
in class.
- Read Ch. 10
- Finish Ch. 5 VB Auto Center #1 only on p. 248. That is, make your
Ch. 4 VB Auto Center project work with ADO object code rather than a Data
Environment.
Copyright © 2001 Curtis Minich. All Rights Reserved.