Thursday, July 17, 2008

vb Question 5

DROPHIGHLIGHT property is for : HITTEST.

1.What r the steps involved in EarlyBinding, How do u create objects using
early binding.
2.Which keywords are allowable in compiler Directives statements :Literal
Statements & except IS Keyword.
3.While running a web page, a user gets a warning about unsafe control and
the control doesn't getdownloaded. Whats the solution ?
4.If you want to install your Visual Basic application in other computer, how
do you find out aboutthe components that are registered in that computer?
5.What type of files does the Setup Wizard generates for Internet download
setup?
6.Know all possible type of files that can you register by using REGSRV32.EXE
7.How can you test the unload behavior of an in-process (ActiveX) DLL
component?
8.How can you debug an (ActiveX) out-of-process component?
9.Variable a is in Procedure A. In the Locals Window we observe its current
value. Then you step into to Procedure B and variable a shows a message "out
of context". What does it mean?
10.Which (2) of the following make a safe ActiveX scripting control for www
applications
[ ] Prompt for a password
[ ] Save to a File
[X] Get information from registry
[X] Save information to registry.
11.What options (switches) should you select in order to optimize performance
for numeric processing while the compiler relies on arguments passed by
reference.
[ ] Assume No Aliasing
[ ] Optimizing for Small Code
[X] Disable Visual Basic Floating Point Error Checking
[X] Remove Safe Pentium FDIV Checks
12.You have Form1 where you drag and place a label named Label1. Pick the
correct line of code that changes the background color of Label1.
13.There is Form1 that has Object1. How can you combine the menu controls of
Object1 in Form1?
a)Using a pop-up menu at run-time. Another option could be to set the
NegociateMenu property of Form1 to true.
14.You set a form with AutoRedraw = False. You have a command button, an
image control, a draw made by the PSET instruction, and a text that uses the
PRINT method. If the form is minimized and then restored, there are two
elments that are going to be di splayed.
The Command Button and the Image Control
15.If you want to display a hierarchical structure of a Web Site, which of
the following controls you should use?
[ ] outline
[ ] listbox
[ ] listview
[X] treeView
16.What can you do with a dynamic menu?
[ ] You can add function keys to it
[X] You can add pop-up menus to it
[X] You can deleted it after creating it
[ ] You can create it from the MenuEditor
17.If you want to offer an option in a help menu for users to access your Web
Site, what ActiveXDocument should you use?
[ ] Automation
[ ] WinSock
[X] Hyperlink
[ ] ActiveX component
18.If we have an ActiveX Component that connects to a database, how can it be
notified if the component connection fails?
19.You have an ActiveX document that uses the AsyncRead method to obtain data
from an intranetlocation. What type of data does it cannot return directly?
[ ] Files
[ ] Byte arrays
[ ] Pictures
[x] Hyperlinks
20.We obtained many DLL functions from different vendors. Two functions
happen to have the same name but different purposes. What can we do?
[X] Using an alias
[X] Declaring each Private in separate modules
[ ] Registering one with another name
[ ] Modifying the DLL function.
21.One question related to sink events for a class named CLASS1 and some
possible answers like:
( ) Dim MyVar AS OBJECT
( ) Dim MyVar AS Variant
( ) Dim MyVar AS New Class1
( ) Dim WithEvents MyVar as Class1
22.Which line of code will create a new instance of an object new Form1 in
Project1.
[ ] Dim Frmx as Form1
[ ] Dim Frmx as New Form1
[ ] Set Frmx = Form1
[X] Set Frmx = GetObject("Project1.Form1")
23.What is the DBGrids default RecordSoruce type
24.What object do i use for the ShowHelp method?
25.You want to minimize download time for an activeX document with several
components. How to package within a .cab file?
26.IIS can not instantiate an object provided by the DLL (ActiveX) What
should you do to the DLL?
27.An ActiveX component connects to a database, the connection to the
database fails. What do?
28.There are 2 deferent dll from 2 vendors and the dll have the same name.
What must you do to be able to call both functions?
29.A control for use all programmers in company. You need debug control
interaction with the same process as one of your applications. How do this?
A. add control project to your app project
B. load control project in second instance
C. in the app proj add a reference to control project
D. in the control proj add a reference to app project
30.Which two required for Early Binding?
A. Type library *
B. Dual Interface
C. New Keyword *
D. CreateObject Function
31.What should you do to debug an out of process component
A. Start a second instance of the development environment *
B. Compile the component by using symbolic debug information
C. Create an errorhandler for the out of process component
D. Create a project group
32.What is the sequence in which the events in the form will trigger ILRAP
à Initialize, Load, Resize , Activate, Paint
33.How do you dynamically create a Commnad button . Already a Command Button
with index 0 exists.
Load Command1(1)
34.What vill be shown when this code is excuted?
Private Sub Command1_Click()
Command2.Value = True
End Sub
Private Sub Command2_Click()
Command1.Value = True
End Sub
Out of Stack Space error
35.What will happen if user presses command2?
Sub Mysub()
static intNum As Integer
If intNum <= 4 Then
Exit Sub
Else
intNum = intNum + 1
Mysub
End If
End Sub
Private Sub Command2_Click()
Mysub
End Sub
36.How to declare a DLL with a C Char datatype?
a) ByVal variable As Byte
37.How to use the Form collection?
Dim a As Form
For Each a In Forms
MsgBox a.Caption
Next
38.What elements exists in Conditional Compiling
a) Literal Expressions
39.What event can handle when a user presess F2
a)Key Down
40.You want your usercontrol to reflect the backcolor of the container what
do u use
a)Ambient.
41.Your application contains the following class names Class1 with a property
named Myproperty.
You run the following code
Dim A as Class1
Dim B as New Class1
B.Myproperty = 3
Set A = New Class1
42) How many instances of class1 exist after your run this code.
a. 0
b. 1
c. 2 (*)
d. 3
43.Which argument of the ADD method is used to specify a node object to
Treeview ?( say creation of a Child )?
Key
Relative
Relationship
43.You have a Label Control in USERCONTROL . If the user resizes the user
control during run-time , in which event will u handle the resizing of the
label ( so as to view the Label control)?
a)USERCONTROL_RESIZE
44.U have a Option Button inside a Frame . The Option Button’s HelpContextId
is 0. If user presses the F1 key, what will happen?
a)Form’s HelpContextId is searched for non-zero value and if so, help is
displayed for the Form
45.If a user sets the LOCKEDIT property of Table to FALSE and another user
updates the Table at the same time. What error will be displayed?
46.If an application is compiled specifically for running on Pentium Pro
Machines ,Which of thefollowing options have to be enabled?
[] Assume no aliasing
[] Floating point division Error
[] optimize for Pentium [tm]
[] Floating Point division by Zero Error
47.U have to indicate the property changes for an object. Which of the
following is best suited for the above scenario?
[] Property Get
[] property Let
[] Public Sub()
[] Public Function()
48.Which of the following is not supported by AsyncRead ?
[] Bitmaps
[] Files
[]
[] HyperLinks *
49.U have 2 tables based upon which reports r to be generated by making use
of a common Field.The existing Table structure and Report definitions should
not be changed.which of the following is most appropriate.
[] create a new table and use Filter
[] Create a new table and use Sort
[] create a new Dynaset using Filter*
[]
50.How to create File option on menu with a Hot Key ALT F?
a) Set Caption to "&File" in Menu for that item

some questons
*************

1. which property sets the value to indicate the display of a lengthy
operation?
a)Value
2)Dragover event of form1 to change bg color of label 1 to red/source.color
=vbred
3)Trap a function key
a)keydown
4)To allow numeric digit only ina txt box which is unbound?
a)keypress
5)Prpperty to access buttons of toolbar?
a)Key and Index
6) Inserting text to statusbar SBI second panel ?
a)sb1.panels(2).text = "....printing"
7)default recordset
a)dynaset type recordset
8)lokedits = false
a)optimistic locking
9)pass an empty valu
a)byval 0& byref vbnullstring
10)which 2 projects contain ActiveX documents
a)Active X.exe and activex.dll
11)activex.dll to multithread
a)activex.exe (convert)
12)when helpcontextid =0 for an object conatined in a frame where does visual
basic look for help?
a)In the controls container
13)what code will gain from being compiled as native code?
a)finacial calculations
14)what cannot be done when an internet control is packaged?
a)write from registry,reading from registry.
15)benefits of form collection
a)Standardised mechanism for for tracking multiple instances of a form
unloading all forms is faster.



Hints:

(a) Scope of Declarations, (Priv, Pub,Static,Global..etc)
(b) Use Collections (0 & 1) based.
(c) Debugging Issues (Local, Watch & Immediate) & their scopes.
(d) Design Issues ( Autoredraw when to set TRUE/FALSE, runtime & degign time
properties available, Using Graphic Methods like PSET..)
(e) Using CLASSES in VB: Develop a small class & try to implement practically the issues
: Inheritance (use AS NEW), Polymorhism (use IMPLEMENTS),Instanceing
(SingleUse,PubCreatble,Global,Multi etc.)
(f) Develop Small AX DLL,AX Control,AX EXE &AX DOC.Know diff Outof &inprocess.
(e) Concentrate of DAO (Locking Issues),Validation & Other Events.
(f) Design a form using Treeview Control,Listview & Imagelist control.If you
only C&P from the example from ONLINE Help, it is sufficient. U got know the
major events & Understand the methods & Properties.
(HIT TEST & DROP HIGHLIGHT PROPERTIES)

FEW QUESTION TOPICS THAT I COULD UNDELETE FROM MY RECYCLING BRAIN
DUMP.
1. U have Form,a FRAME & ListBox inside frame. If u set SORT property of
Listbox at design time,what will happen.Pls refer other Articles in the brain
dump for this Question.
2. What is the Only Poperty available for collection : Count.
3. Which Option will not allow to create instances : set Public to FALSE
4. How do u create a PUBLICLY READONLY property and PRIVATE READ/WRITE
Property.(Brilliant Question...Observe Public & Private).
5. Files The Get Generated while creating Internet Distribution files:
.CAB,.HTM & .INF.
6. DRAG DROP : What Does State Parameter of Mouse event Signifies.
7. What r the only design & Run time properties available for a Menu.
8. DROPHIGHLIGHT property is for : HITTEST.
9. How do u dynamicaly load controls : Load,Move,Visible.
10.How do set a text into 2nd panel of statusbars Panel Collection.
11.What Property will u use to access BUTTONS of TOOLBAR : Key & Index.
Note: Here Key can also be used to uniquely access buttons on toolbar
12.What r the steps involved in EarlyBinding, How do u create objects using
early binding.
13.If a variable is declared as PUBLIC in Forms Declaration what is its scope
: - Complete APP
- Only to procedures inside the form
- Procedures which r declared as public
- Procedures which r declared as PRIVATE.
14. One Question of Friend Property. It was pretty simple.
15. One Question on Pessimistic & Optimistic Locking.
16. Which type of recordset u will use to populate country names into a
listbox.
17. Which recordset u will use to find a record in multiuser environment
18. Which event will get fired when u move from 1 record to the other.
19. how do u pass NULL to a DLL: ByRef vbNullStrig, ByVal 0 as long
(or ByVal 0&)

1.Your application contains the following class names Class1 with a property
named Myproperty. You
run the following code:
Dim A as Class1
Dim B as New Class1
B.Myproperty = 3
Set A = New Class1
2)How many instances of class1 exist after your run this code.
a. 0
b. 1
c. 2 (*)
d. 3

2. You want to create an instance of an ActiveX component that can
Asynchronously signal projects that
use it. what should u create (Choose two)?
a. an event
b. an object callback (*)
c. the Addressof Operator (*)
d. the Implements statement
3.What control can u place on an MDI form.
a. Image (*)
b. Picture Box
c. Option Control
d. Frame
4.some question like u have two forms Form1 and Form 2 and u want to trigger
a terminate event for the first Form from the Second Form.
the correct answer is:
Unload Form1
Set Form1 = Nothing
5.The record set validate event is done only when.
a. when u move to the next control
b. Only when u move to the next record (*)
6.The Record Set record count only when u access all the records.
7. Scope of a public variable in a form
Accessable from all procedure and function in the Form.
8.What cannot be done when an Internet Control is packaged (Choose Two)?
Write to a file
read from the registry
9. Save settings
HK_CurrentUser
10.Code for Toolbar Click Event
Button.key
11.You have two text boxes Text1 and Text2. the Tab index of text1 is set to
0. what will happen when
u set the tab index of text2 to 0?
Tab index of text1 is set to 1
12. Arguements for property Procedures (Choose Two)?
AddressOf (*)
Alias
Param Array(*)
Optional
13.For Early Binding
Dim varname as Class
Set varname = CreateObject(ClassName)
14.To Show Help method witrhout declaring a DLL
First create a Common Dialog Control
15.To pass a null value to a DLL (Choose Two)
By Ref vbNullString
By Val long 0
16. How to debug an ActiveX control?
use the raise method
1.If you want to install your Visual Basic application in other computer, how
do you find out about the components that are registered in that
computer? REGSRV32.EXE
2.How can you build ActiveX components for Internet distribution? Use the
Application Setup Wizard and pick the appropriate options.
3.What type of files does the Setup Wizard generates for Internet download
setup? *.CAB files.
4.Know all elements shown in the Add Watch Window (Debugging)
5.Know all elements shown in the Locals Window (Debugging)
6.Know all possible type of files that can you register by using REGSRV32.EXE
. (i.e.: .DLL,.OCX, etc.)
7.How can you test the unload behavior of an in-process (ActiveX) DLL
component? You can add
a standard EXE project to the ActiveX DLL¦s project group, and test the
in-process component
within a single instance of Visual Basic.
8.How can you debug an (ActiveX) out-of-process component? To test an
ActiveX EXE, you must
run the component within one instance of Visual Basic, and run the test
application in a second
instance of Visual Basic.
9.Know all the options available within the "Compile" tab in the Project
Properties when making a
new project. (i.e.: Compile to Native Code -> Favor Pentium Pro (tm),
Advanced Optimizations
-> Remove Integer Overflow Checks, etc.)
10.Variable a is in Procedure A. In the Locals Window we observe its
current value. Then you step
into to Procedure B and variable a shows a message "out of context".
What does it mean?
Variable a was local to Procedure A (neither public nor static).
11.One question on conditional compilation to choose the right construct
(learn the syntax for #ifdef
#elseif #endif)
12.There is a www server application that uses ActiveX controls you
developed. When the
application page is browsed with IE it does not show the ActiveX
control. What may be
happening? Options in the Application Setup Wizard were not used
correctly.
13.Which (2) of the following make a safe ActiveX scripting control for
www applications

[ ] Prompt for a password
[ ] Save to a File
[X] Get information from registry
[X] Save information to registry.
14.What options (switches) should you select in order to optimize
performance for numeric
processing while the compiler relies on arguments passed by reference.

[ ] Assume No Aliasing
[ ] Optimizing for Small Code
[X] Disable Visual Basic Floating Point Error Checking
[X] Remove Safe Pentium FDIV Checks
15.You have Form1 where you drag and place a label named Label1. Pick the
correct line of code
that changes the background color of Label1.
16.There is Form1 that has Object1. How can you combine the menu controls
of Object1 in Form1?
Using a pop-up menu at run-time. Another option could be to set the
NegociateMenu property of
Form1 to true.
17.You set a form with AutoRedraw = False. You have a command button, an
image control, a draw
made by the PSET instruction, and a text that uses the PRINT method.
If the form is minimized
and then restored, there are two elements that are going to be di

The Command Button and the Image Control
18.If you want to display a hierarchical structure of a Web Site, which of
the following controls you
should use?

[ ] outline
[ ] listbox
[ ] listview
[X] treeView
19.What can you do with a dynamic menu?:

[ ] You can add function keys to it
[X] You can add pop-up menus to it
[X] You can deleted it after creating it
[ ] You can create it from the MenuEditor
20.Know the DropHighLight property of TreeView.

The DropHighLight property is used to do drag and drop operations in a
TreeView.
21.Characteristics of the DragOver Event.



Used for drag and drop operations with forms, and other objects as
pictures.
22.If you want to offer an option in a help menu for users to access your
Web Site, what ActiveX
Document should you use?:

[ ] Automation
[ ] WinSock
[X] Hyperlink
[ ] ActiveX component
23.Know the function and syntax of Param Array
24.Know all about how to implement HelpFiles in an application
25.If we have an ActiveX Component that connects to a database, how can it
be notified if the
component connection fails?
26.Know all about using class modules
27.Know how to declare DLL functions.
28.You have an ActiveX document that uses the AsyncRead method to obtain
data from an intranet
location. What type of data does it cannot return directly?

[ ] Files
[ ] Byte arrays
[ ] Pictures
[X] Hyperlinks
29.What is the purpose of the Implements keyword?

The Implements keyword is used to create a secondary interface. For
instance, if your application
has a reference to a type library that describes the IGrowth interface,
you could create a
secondary interface in a class module using "Implements IGrowth".
30.Why would you want to set the LockEdits property to False?

If LockEdits is set to False (for optimistic locking), then the 2K page
containing the record will
remain locked, and then updated upon executing the Update method only.
31.We obtained many DLL functions from different vendors. Two functions
happen to have the same
name but different purposes. What can we do?

[X] Using an alias
[X] Declaring each Private in separate modules
[ ] Registering one with another name
[ ] Modifying the DLL function.
32.Know the differences between early binding vs late binding

Late binding occurs when the compiler does not know about an object
until run time.
Early binding occurs when Visual Basic knows at compile time exactly
which interface will be used
with an object variable.
33.One question related to sink events for a class named CLASS1 and some
possible answers like:

( ) Dim MyVar AS OBJECT
( ) Dim MyVar AS Variant
( ) Dim MyVar AS New Class1
( ) Dim WithEvents MyVar as Class1
34.Know all about Forms Collection
35.Which line of code will create a new instance of an object new Form1 in
Project1.

[ ] Dim Frmx as Form1
[ ] Dim Frmx as New Form1
[ ] Set Frmx = Form1
[X] Set Frmx = GetObject("Project1.Form1")
36.How can you create a read-only property for a class?

[ ] Define a Property Get procedure and define a Property Let
procedure with no
arguments.
[ ] Define a Property Get procedure and a Property Let procedure.
[X] Define a Property Get procedure without a Property Set or
Property Let procedure.
[ ] Define a Property Set or Property Let procedure without a
Property Get procedure.
37.Advantages of Using ActiveX Documents (Choose 2).

The ActiveX Documents offer many advantages and increased
functionality to both the user
and the application developer. The most important advantage for
developers in using
ActiveX documents is the ability to apply existing programming
skills. Developers
38.What is the purpose of the ID parametr in an HTML tag?

[ ] Specifies a URL that points to a file containing an
implementation of an object.
[ ] Specifies the object's unique class identifier stored in the
system registry.
[ ] Specifies a URL that points to the name of the object.
[X]Specifies the object name.
39.How can you create a read-only property private and a write-only
property Public. Which of the
following are true?

[X] Private Property Get Name() As String
Name = txtname.text
End Property
Public Property Let Name(ByVal NewName as String)
TxtName.text = NewName
PropertyChanged "Name"
EndProperty

[ ] Public Property Set Name() As String
Name = txtname.text
End Property
Private Property Let Name(ByVal NewName as String)
TxtName.text = NewName
PropertyChanged "Name"
EndProperty

[ ] Public Property Let Name() As String
Nsme = txtname.text
End Property
Public Property Set Name(ByVal NewName as String)
TxtName.text = NewName
PropertyChanged "Name"
EndProperty
40.How do you create a license package file containing the licensing
information for all controls on a
Web page?

[ ] With the Visual Basic License Manager.
[ ] With the CODEBASE parameter of an HTML page'stag.
[ ] With the Visual Basic Application Wizard.
[X] With a utility form the LPK_TOOL directory on the Visual Basic
CDROM.
41.What elements of ActiveX Components on a Web page contribute to
security?

When you use ActiveX controls on a Web page, you can implement the
following security measures: Set the appropiate level of security in
Internet
Explorer, Provide users with information about the author of the
control, Through digital code
signing, Create an Internet download by marking your Controls as safe
for scripting and
initialization.
42.Which code segment would best trap a "division by zero" error
handling?

For example: (See Error Handling)

Public Sub ProcDivZero()
On Error GoTo ErrTrapper
X = 100 / 0
Y = X / 0
Exit Sub
End Sub
ErrTrapper
If Err.Number = 11 Then Debug.Print "Division by Zero Found"
EndProc
43.Which is the difference between debugging an ActiveX control project
and an in-process
component?
The componet code can run while the client is in Design mode.
(See Mastering VB5: ActiveX
Control).
44.Which project template would you select to build an in-process code

(ActiveX Document DLL)?
Add object dialog.

Your Title