- Placement Papers
- Interview Zone
- Resume Corner
- Contact Us
(Interview) Visual Basic Interview Questions (Page-4)
Submitted by admin on Sat, 2008-06-21 16:10
modal and moduless window?
Interview : Visual Basic Interview Questions
Page - 4
modal and moduless window?
MODAL forms are forms which require user input before any other actions can be taken place. In other words, a modal form has exclusive focus in that application until it is dismissed. When showing a modal form, the
controls outside this modal form will not take user interaction until the form is closed. The internal MsgBox and InputBox forms are examples of modal forms. To show a form modally, use the syntax:
MyForm.SHOW.vbModal ' a predeclared constant for 1
MODELESS forms are those which are shown but do not require immediate user input. MDI child forms are always modeless. To show a form modeless, use the syntax:: MyForm.SHOW
Difference Object and Class?
Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.
1)A Class is static. All of the attributes of a class are fixed before,during, and after the execution of a program. The attributes of a class don't change.The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.
2)An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that lifetime, the attributes of the object may undergo significant change.So basically the difference between a class and an object is that a class is a general concept while objects are the specific and real instances that embody that concept. When creating an object oriented program we define the classes and the relationships between the classes . We then execute the program to create, update, and destroy the objects which are the specific realization of these classes.
Difference Query unload and unload in form?
Occurs before a form or application closes. When an MDIForm object closes, the QueryUnload event occurs first for the MDI form and then in all MDI child forms. If no form cancels the QueryUnload event, the Unload event occurs first in all other forms and then in an MDI form. When a child form or a Form object closes, the QueryUnload event in that form occurs before the form's Unload event.
Difference Declaration and Instantiation an object?
Dim obj as OBJ.CLASS with either
Set obj = New OBJ.CLASS or
Set obj = CreateObject(?OBJ.CLASS?) or
Set obj = GetObject( ,? OBJ.CLASS?)
Dim obj as New OBJ.CLASS
Set object = Nothing
ensure the object is release from the memory.
If this object is a form, you can add set myform = nothing and Form_Unload() event.Maintain a habit of remove the object by using set object = nothing which will benefit at last.
Visual Basic is supposed to automatically release objects when they go out of scope. To free up some memory usage, you can set the object to
Draw and explain Sequence Modal of DAO:
Version |Year |Significant Changes and New Features of Visual Basic?
1 1991 initial release, with drag and drop GUI creation
2 1992 ODBC, object variables
3 1993 Access Engine, OLE 2.0, Crystal Reports, new tools and controls
4 1995 classes, OCXs
5 1997 compiler, ActiveX controls
6 1998 web support, windowless controls, designers, data sources
.NET 2001 XML, SOAP, inheritance, structured exception handling
How can objects on different threads communicate with one another?
Processes communicate with one another through messages, using Microsoft's Remote Procedure Call (RPC) technology to pass information to one another. There is no difference to the caller between a call coming from a process on a remote machine and a call coming from another process on the same machine.
Multithreaded applications must avoid two threading problems: deadlocks and races. A deadlock occurs when each thread is waiting for the other to do something
How can you force new objects to be created on new threads?
The CreateThread function creates a thread to execute within the virtual address space of the calling process.
To create a thread that runs in the virtual address space of another process Creating a new thread is as easy as declaring it and supplying it with a delegate to the method where the thread is to start. When you are ready to begin execution on the thread, call the Thread.Start Method. There are special considerations involved when working with multiple threads of execution.
To create a new thread of execution
Declare the thread.
' Visual Basic
Dim myThread as System.Threading.Thread
Instantiate the thread with the appropriate delegate for the starting point of the thread. Use the AddressOf operator to create the delegate
in Visual Basic, or create a new ThreadStart object in C#.
' Visual Basic
myThread = New System.Threading.Thread(AddressOf
myThread = new System.Threading.Thread(new
call the Thread.Start method to start the thread.
' Visual Basic
How does a DCOM component know where to instantiate itself?
To create a remote instance of a script component, call the CreateObject method, passing it the name of the remote computer as a parameter. If the remotable attribute of a script component's <registration> element has been set to "true," the script component can be instantiated remotely from another computer using Distributed COM (DCOM).
Both computers must have basic DCOM installed. Note The ability to use CreateObject for instantiating remote script components requires Visual Basic 6.0 or later or VBScript 5.0 or later. The following Visual Basic example shows how to do this on a computer named "myserver":
Set newS = CreateObject("Component.MyComponent", "myserver")
Note There can be a slight delay when you first instantiate a remote script component while DCOM establishes communication between the computers.
1. You can specify the machine on which you want to create the remote server object in DCOM config ('dcomcnfg').
2. You can specify the machine name when instantiating the remote server object.
In C you can do this with a call to CoGetClassObject or CoCreateInstanceEx (instead of CoCreateInstance, which does not allow you to specify the name of the machine).
In VB you can specify the name in one of the parameters in the call to CreateObject