• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » VB » VB oops

What is DLL (Dynamic-linked library)?

By Dinesh Thakur

(Dynamic-linked library) In programming, a type of LIBRARY file that becomes LINKED to a program that uses it only temporarily when the program is loaded into memory or executed, rather than being permanently built-in when the program is COMPILED. The same DLL may therefore be shared by many different programs, rather than each program having to contain its own copy; this saves on memory usage and potentially simplifies the updating of programs.

Microsoft WINDOWS was the first operating system to make heavy use of DLLs, with large parts of the operating system itself (e.g. KERNEL32.DLL) and of Microsoft Office applications existing in DLL format. The use of DLLs should simplify the distribution of updates to programs, but in practice they are a double-edged weapon, as installing new programs can cause chaos by overwriting DLLs needed by others with incompatible versions

What is compile time?

By Dinesh Thakur

This phrase has two meanings. Compile time can refer to how long it takes to compile a given program (see the entry above). The compile time for a program depends on how long and complicated the program is, the speed of the computer, and the quality of the compiler.

The other meaning of compile time has to do with events that happen at the time a program is compiled, or “at compile time.” A programmer may say, “Specific values are assigned to those variables at compile time.”

How can we write methods for a new class

By Dinesh Thakur

To hold the internal data of our class create private variables in the general declaration of the class modules. Then we have to deign which properties we want to write access. We can decide these things using property get and property let procedures.

 

A property get is like a function that returns the information about. The property let is like a procedure we can use to set information in the private variables.

The way that our class allows its property to be set is through property let property and to retrieve the value of a property from a class, we must use property get procedure.

The property let and property get procedure and retrieve the property value to provide member to the class module.

 

Syntax for get procedure:-

 

(Public) property get procedure_name(Optional argument list) as datatype

Statements in procedure

Procedure_name = property_name

End procedure

 

Property procedure are public by default, so we can omit the optional public keyword. We can also define a property to be private which means that the property is available only inside a class module.

 

What steps are needed to assign property values to an object

By Dinesh Thakur

Inside our class, we define variables, which are the properties of the class. We could declare all the variables as Public so that all other project code could set and retrieve their values.

 

However, this approach violates the rules of encapsulation that require each object to in charge of its own data. Encapsulation is also called data hiding. To accomplish encapsulation, we will declare all variables in a class module as Private.

When our program creates object from our class, we will need to assign values to the properties. Because the properties are private variables, we will use special property procedures to pass the values to the class module and to return values from the class module.

 

 

What actions trigger the initialize and the terminate event of the object

By Dinesh Thakur

The Class_initialize event is triggered when an object is created and the Class_initialize event occurs when an object goes out of scope or is terminated with

 

Set ObjectName = Nothing. These event procedures are useful for doing any setup work for making sure that the memory allocated for an object is released.

 

Public Sub Class_Initialize()

‘ Create the collection object

Set mProducts = New Collection

End Sub

Public Sub Class_Terminate()

‘ Remove the collection from memory

Set mProducts = Nothing

End Sub

 

Explain the difference between ByVal and ByRef. When is each used

By Dinesh Thakur

When we pass a value to a procedure we may pass it ByVal or ByRef.

 

 

ByVal

 

ByRef

The ByVal sends a copy of the argument’s value to the procedure.

The ByRef sends a reference indicating where the value is stored in memory, allowing called procedure to actually change the argument’s original value.

When we want to pass copy of argument we can use ByVal keyword.

When we want to pass the reference to the calling procedure we can use ByRef keyword. The ByRef is Default.

Syntax is :

Private Sub Procedure_name(ByVal var as Integer)

Syntax is :

Private Sub Procedure_name(ByRef var as Integer)

For ex.

Private Sub SelectColor(ByVal lngIncomingColor as Long)

‘ Do Something

End Sub

For ex.

Private Sub SelectColor(ByRef lngIncomingColor as Integer)

‘ Do Something

End Sub

 

 

What are the purpose of a Declare Statement

By Dinesh Thakur

Declaring variables means naming the variable and specifying their data types, that is declaration statements establish our project’s variables and constants give them names, and specify the data type they will hold.

 

These declaration statements are not considered as executable ; that is, they are not executed in flow of instructions during program execution.

Although these are several ways of declaring the variables, the most commonly used way is the Dim statements with the data type. We can omit the data type, then default data type becomes variant.

 

Here are some sample examples for declaration statement :

 

Dim strName as String ‘Declared the String variable

Dim intCount as Integer ‘Declared an Integer variable

Dim curDiscount as Currency ‘Declared a currency variable.

 

Primary Sidebar

Visual Basic Tutorial

Visual Basic Tutorial

  • VB - File Types Purpose
  • VB - Events
  • VB - Ole
  • VB - Controls Properties
  • VB - Project Steps
  • VB - Pretest Vs Posttest
  • VB - IDE
  • VB - Record Set
  • VB - Common Dialog Box
  • VB - Val Function
  • VB - Sub Vs Function Procedure
  • VB - Terms
  • VB - User Interface Elements
  • VB - Objects and Modules
  • VB - Variable’s Scope
  • VB - Message Box
  • VB - Data Vs Data-bound Control
  • VB - Branching Statements
  • VB - Do/Loop and For-Next Loop
  • VB - Grid Control
  • VB - Error Types
  • VB - Looping Constructs
  • VB - Relational Vs Logical Operator
  • VB - Control Purpose

Other Links

  • Visual Basic - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW