Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Visual Basic > ActiveX

ActiveX - Page 2

21-40 of 183     Previous     Next
Creating an MSACCESS Database through VB
by Nazmul Siddiqui
I have frequently seen bulletin board requests on how to create MSACCESS databases with VB. To do this, add a reference to the Microsoft DAO _._ Object Library (I am using Version 3.6 for the ...
A Quick Way to Register and Unregister DLLs
by Chris McCann
It's really a pain to continually register, unregister, and reregister a DLL (or worse, many DLLs) using REGSVR32. Importing the following into your registry, allows you to set up options in the ...
Adding Popup Menus to Custom Controls
by Nazmul Siddiqui
Shipping custom controls with their own set of popup menu items make the controls appear appropriately professional. They add ease of use, functionality and value to the control(s). Here's how it ...
Clear a MaskEditBox control without raising error
by Francesco Balena
You can't clear the contents of a MaskEdBox control by setting the Text property to a null string if the MaskEdBox's Mask property contains delimiter. In fact, you must include those separators in the value you assign to the Text property, otherwise you get Error 380 - Invalid property value.
Pass the hidden Global object to an ActiveX DLL
by Francesco Balena
An ActiveX DLL doesn't have direct access to the environment of the calling EXE. For example, the App and Printer objects in the DLL don't correspond to the objects with the same name in the main application, therefore if you want to print something from the DLL using the same settings as the ...
Insert a picture into a RichTextBox control
by Francesco Balena
Here's a simple method to programmatically insert an image into a RichTextBox control, by copying it into the clipboard and then pasting it into the control: Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As ...
Passing an ActiveX Control As a Parameter
by Mahesh Hegade
Trying to pass an ActiveX control as a parameter to a method on an external ActiveX DLL (or EXE), garners a
Changing the current record using bookmarks
by Marco Bellinaso
If you try to use a DataList and some labels or text boxes linked to an ADO Data control, and you click on some items in the list, you'll notice that the data in the labels won't change, because the current record isn't changed. To have the code work correctly, you have to write code in ...
GetClasses - Enumerate all the classes defined in a type library
by Alberto Falossi
Return a collection with all creatable classes of the type library specified in TypeLibFile. Set IncludeNotCreatableClasses = True to include not creatable classes (that is, those with Instancing property set to PublicNotCreatable) too. Be sure that "TypeLib Information" type library (TlbInf32.
GetClassesByInterface - Retrieve all the classes that implement a given interface
by Alberto Falossi
Return all classes of the type library specified in TypeLibFile parameter that support a certain interface. the interface can be specified as an Object or through its IID Be sure that "TypeLib Information" type library (TlbInf32.tlb) is referenced in your VB project.
GetClassesByMember - Retrieve the list of classes that expose a given property or method
by Alberto Falossi
return a collection with names of all the class names of a type library that implement a certain member. MEMBERNAME is the name of the property or method MEMBERTYPE is the type of the member (vbGet, vbLet, vbSet, vbMethod). You can specify multiple types by ORing these constants Example:
GetHiddenClasses - Retrieve all the hidden classes in a type library
by Alberto Falossi
Return a collection with all hidden types of a type library VB's Object Browser hides some types in a type library: you can show these types by right clicking on the Object Browser and activating the "Show hidden members" option. This option, however, shows only types labelled as "hidden", ...
GetMemberType - Check whether an object exposes a property, method, event
by Alberto Falossi
Returns a bit-coded value that specifies the type of an object's member (property, method, event) or zero if the member isn't there Object is the object which you want to work MemberName is the property, method or event name the return value is one of the following INVOKE_FUNC (method)
GetObjectGUID - Retrieve the GUID of a COM object
by Alberto Falossi
Return the GUID of the object specified in the first parameter Be sure that "TypeLib Information" type library (TlbInf32.tlb) is referenced in your VB project.
GetProcID - Retrieve the DispID of a procedure
by Alberto Falossi
Return the DispID of a procedure ProcName must be set to a procedure name of the object specified in the second parameter. Be sure that "TypeLib Information" type library (TlbInf32.tlb) is referenced in your VB project.
Detect when a new control is added to an ActiveX container
by Francesco Balena
You can easily create ActiveX controls that work as containers for other controls, by setting their ControlContainer property to True. However, VB doesn't offer any event for detecting when the programmer adds or remove controls to the ActiveX control, after placing it on a form's surface.
Creating help string for Enum constants
by Carl-Johan Lindgren
I've been trying to find a way to assign helpstrings for Enums in Visual Basic. The Class builder utility does that only for methods, events, and properties, but not for Enums. The IDL source code that corresponds to an Enum in a type library looks something like follws, and you can run ...
Simple Component Testing
by David A.
When creating ActiveX components, an easy way to test them is to add a module to the project (see the code below). In this module you can write methods that will instantiate your component and then ...
Updating records in DataList and ADO Data Controls
by Marco Bellinaso
If you use a DataList control linked to an ADO Data Control and if you want to add a record, you have to create a command button with this code: Private Sub cmdAdd_Click() On Error GoTo AddErr datPrimaryRS.Recordset.AddNew txtNew.SetFocus Exit Sub AddErr: MsgBox Err.
Define Named Ranges in Excel Before Executing Queries
by Michael J.
Once you've established a connection to Microsoft Excel using OLE DB, you're not out of the woods. You still have to define a Named Range in Excel; then you can treat this named range like a database ...
21-40 of 183     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date