Category Archive for: Building AdiveX Components

The String Class

The last example in this section is a very simple Class that implements a few useful string operations The String Class provides three methods which are implemented as Public functions and they are: •Integer2Binary(number As.Long) Converts its numeric argument to a binary number arnd returns the binary value as a string . • Number2String(number As Integer) Converts its…

Read More →

The AX5tat Class Custom Members

Public Property Get Average() As Double Dim dSum As Double Dim itm As Long For itm – 1 To Data Collection Count dSum – dSum + DataC~llection(itm? Next Average – dSum / Data Collection.Count ‘End Property Public Property Get Min() As Double Dim itm’As long Min – lE+202. For itm – 1 ,To Data Collection.Count…

Read More →

Implementing collectin Properties

Some ActiveX components provide array or Collection properties. For example the . List Box control exposes the List property which is an array. The items of the List Box control are stored in the List array which is a property of the control. and they can l accessed by an index that goes from 0 to…

Read More →

Referencing the EventTimer Class in Other Projects

To use a Class in another project you must first add a reference to the Class. This means that you must make the component available to the system by registering it as explained in the previous section. Once the DLL (or EXE) file of the component has been created and registered with the host system, fully project or…

Read More →

Registering an ActiveX Component

Classes are registered automatically on the system on which they are designed. When you create DLL or EXE file that implements the Class, Visual Basic also registers it. But what if you Want to make the Class available to other developers working on different systems? If the component is an EXE server you can distribute the EXE file. Once…

Read More →

The Class Instancing Property

As you’ve noticed Classes have a few properties. In this chapter we discuss only . two of them: the Name property and the Instancing property. The instancing property determines whether and how applications can use the Class. Its six possible settings are discussed next. Private Private objects can only be accessed by components in the same application. If you’re…

Read More →

Setting Project Properties

This point, we’ll take a bleak to discuss the Project Properties dialog box. most of the entries in this dialog box are obvious, but some aren’t. Also, some seemingly obvious options may have ramifications you must be aware of. You can’ skip The project Properties dialog box, shown in Figure 15.5: lets you select a project type and set various options…

Read More →

Raising Events from within Classes

“This topic is rather advanced and you can safely skip it. Raising events from with in classes is not a very common practice. Since Classes don’t have a visible  user interface there are no external events to react to and from which to raise events. In the following chapter you ‘team how to raise events from within ActiveX controls have…

Read More →

Class Module Properties

Although a Class’ properties can be implemented as public variables, Visual Basic provides the Property Let and Property Get procedures for accessing them. The proper method of implementing a property in your Class is to’ add the following procedures: Private m_Int Property Public Property Let IntProperty(new Value As Integer) m_IntProperty = new Value End Property Public property.Get…

Read More →

Private and Friend Members

Class Modules may contain private procedures’ too. These procedures can be called from within the Class’ code, but other applications that use the Class can’t call them. If you want to keep track of how many times a method-has been called during  the course of an application, you can include a function like the following one: Private…

Read More →

Back to Top