Apply Your Knowledge

C. Dim objMyVar As Object

Set objMyVar = New WordDoc

D. Dim objMyVar As Object

Set objMyVar = GetObject("App.WordDoc")

E. All these statements

3. The reference to Object Libraries provides Visual Basic with which of the following information?

B. A list of objects.

C. Object types supported by the ActiveX Server and their properties and methods.

D. Functions for creating object libraries.

4. Which of the following statements will define an object variable and return a valid object reference of type Application?

A. Dim x as Object

Set x = New Application

B. Dim x as new Application

C. Dim x as Application

D. Dim X as Object

Let X = new Application

5. Assume that you have a COM component with an application name of MyApp and an object called Spreadsheet. Which one of the following statements enables you to access that object?

A. Dim objX as new CreateObject("SpreadSheet")

B. Dim objX as Object

Set objX = CreateObject("MyApp")

C. Dim objX as Object Set objX =

CreateObject("MyApp.SpreadSheet")

D. Dim objX as Object

Set objX = CreateObject("SpreadSheet")

E. This cannot be done because the object reference library is not added to the project.

6. If the following code is executed and the server is not running in memory, what occurs?

Set objInfo = GetObject("Word.Application")

A. The application is loaded into memory and an object reference is returned.

B. A runtime error occurs.

C. The application will not be loaded because the path is not correct.

D. The application is loaded into memory and nothing is returned.

7. Assume that you have a COM component named MyApp and an object class MyClass that supports events. The proper way to declare an instance of MyApp.MyClass so that you can program with its events is

A. Private WithEvents objMine As MyApp.MyClass

B. Private WithEvents objMine As New MyApp.MyClass

C. Private objMine WithEvents As New MyApp.MyClass

D. Private objMine WithEvents As MyApp.MyClass

8. When you program with an object class using WithEvents (pick all that apply):

A. You must place the object's declaration in the General section of the module.

B. You must write the event procedures "from scratch" in the General section of the module.

0 0

Post a comment