Professional Documents
Culture Documents
DLL Servers
DLL Servers
A DLL is a library that contains code and data that can be used by more than one
program at the same time.
By using a DLL, a program can be modularized into separate components.
For example, an accounting program may be sold by module. Each module can be
loaded into the main program at run time if that module is installed. Because the
modules are separate, the load time of the program is faster, and a module is only
loaded when that functionality is requested.
updates are easier to apply to each module without affecting other parts of the program.
For example, you may have a payroll program, and the tax rates change each year.
When these changes are isolated to a DLL, you can apply an update without needing to
build or install the whole program again.
The following list describes some of the files that are implemented as DLLs in Windows
operating systems:
1.ActiveX Controls (.ocx) files
An example of an ActiveX control is a calendar control that lets select a date from a
calendar.
DLL ADVANTAGES:
When multiple programs use the same library of functions, a DLL can reduce the
duplication of code that is loaded on the disk and in physical memory.
This can greatly influence the performance of not just the program that is running in the
foreground, but also other programs that are running on the Windows operating system.
When a function within a DLL needs an update or a fix, the deployment and installation
of the DLL does not require the program to be relinked with the DLL.
if multiple programs use the same DLL, the multiple programs will all benefit from the
update or the fix.
DLL TYPES:
When we load a DLL in an application, two methods of linking call the exported DLL
functions.
The two methods of linking are load-time dynamic linking and run-time dynamic linking.
In run-time dynamic linking, an application calls either the LoadLibrary function or the
LoadLibraryEx function to load the DLL at run time.
After the DLL is successfully loaded, use the GetProcAddress function to obtain the
address of the exported DLL function that want to call.
When we use run-time dynamic linking, we do not need an import library file.
When the user drags data from an OLE drag source (a text box control, for example) by
selecting and then holding down the left mouse
button, the OLEStartDrag event is triggered and then either store the data or simply
specify the formats that the source supports.
Also need to specify whether copying or moving the data, or both, is allowed by the
source.
Dragging Over the Target:
when the user drags over the target, the target’s OLEDragOver event is triggered,
indicating that the source is within its boundaries.
specify what the target would do if the data were dropped there — either copy, move, or
refuse the data.
the default is move, but it may be copy.
When the target specifies which drop effect will be performed if the source is dropped
there,
the OLEGiveFeedback event is triggered.
The OLEGiveFeedback event is used to provide visual feedback to the user on what
action will be taken when the selection is dropped.
i.e., the mouse pointer will be changed to indicate a copy, move, or "no drop" action.
As the source is moved around within the boundaries of the target — or if the user
presses the SHIFT, CTRL, or ALT keys while holding down the mouse button — the drop
effect may be changed.
For example, instead of allowing a copy or a move, the data may be refused.
If the user passes beyond the target or presses the ESC key,for example, then the drag
operation may be canceled or modified.
Completing the Drag:
When the user drops the source onto the target, the target’s OLEDragDrop event is
triggered.
The target queries the source for the format of the data it contains and then either
retrieves or rejects the data.
If the data was stored when the drag started, the target retrieves the data by using the
GetData method.
If the data wasn’t stored when the drag started, the data is retrieved by triggering the
source’s OLESetData event and then using the SetData method.
When the data is accepted or rejected, the OLECompleteDrag event is triggered and the
source can then take the appropriate action:
if the data is accepted and a move is specified, the source deletes the data.
VB6 supports several drag and drop types:
Standard and OLE drag and drop with manual and automatic modes for both types.
Data is passed by using the source control as a drag and drop parameter.
The drag operation sets the source control in drag and drop mode.
DragOver and DragDrop event handlers in the target control receive the source control
so they can obtain the data to be copied or moved from the source control itself.
object.Drag-Start drag method
object_DragDrop-Drag drop event handler
object_DragOver-Drag Over event handler
Data is passed by using the source control as a drag and drop parameter.
The data to be copied or moved is set at the beginning of the drag and drop operation
inside the OLEStartDrag event handler or by demand by the OLESetData event handler.
The OLEDragOver and OLEDragDrop event handlers received the data in a DataObject
parameter.
object.OLEDrag -Start drag method
object_OLEStartDrag-Start drag event handler
object_OLEDragDrop-Drag Drop event handler
object_OLEDragOver-Drag Over event handler
Controls recognize a mouse event only when the mouse pointer is inside the control.
If a mouse button is pressed and held while the mouse pointer is inside a control or
form.that object captures the mouse.
Syntax:
objectname_MouseEvent(Button As Integer,Shift As Integer,X As single,Y As Single)
MouseUp,MouseDown Events:
Example:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, y As
Single)
Circle (X, y), 75
End Sub
MouseMove event uses the three lower bits of the value of the Button parameter to
identify the complete state of the mouse button.