Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.
This tip is extremely useful in the IDE for debugging. Before the Do loop you want to make safe, you set the var ‘loopnum’ as 0. Then, place these two
Debugging ActiveX EXE components is different from debugging ActiveX DLL components, and a bit more difficult. Here is how to do it: 1. Run your ActiveX EXE component in the
Sometimes we may need to register/unregister a DLL or OCX programatically. This piece of code can do that. Private Declare Function RegisterDLLOCX Lib _
The following code is an efficient, flexible, system-setting-independent procedure. MonthNames is either a listbox or a combobox. If StartMonth is greater than EndMonth, the list of month names will be
Here is a sipel function for stripping double characters from a string: Public Function StripDoubleChar(ByVal Text As String, Char As String) As StringDim Pos As LongDim Start As IntegerDim sTemp
This control allows you to place several toolbars on very little space, bycreating several tabs and showing one toolbar for each tab. The user canswitch beetwen the tabs and the
‘ Get the name of the DLL or EXE that contains’ the class whose CLSID is passed as an argument” Note: Remote servers aren’t taken into accountFunction GetFileFromCLSID(ByVal clsid As
‘ Get the name of the DLL or EXE that contains’ the class whose ProgID is passed as an argument” Remote servers aren’t taken into account” NOTE: Requires GetRegistryValueFunction GetFileFromProgID(ByVal
Private Declare Function GetSaveFileName Lib “comdlg32.dll” Alias _ “GetSaveFileNameA” (pOpenfilename As OpenFilename) As LongPrivate Type OpenFilename lStructSize As Long hwndOwner As Long hInstance As Long lpstrFilter As String lpstrCustomFilter As
‘check whether the specified file is an executable,’ by checking the last 4 characters.’Example: MsgBox “File is exe: ” & IsExecFile(“C:windows otepad.exe”)Function IsExecFile(ByVal sFileName As String) As Boolean Dim sExt
Private Declare Function GetOpenFileName Lib “comdlg32.dll” Alias _ “GetOpenFileNameA” (pOpenfilename As OpenFilename) As LongPrivate Type OpenFilename lStructSize As Long hwndOwner As Long hInstance As Long lpstrFilter As String lpstrCustomFilter As
Private Declare Function FindFirstFile Lib “kernel32” Alias “FindFirstFileA” _ (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As LongPrivate Declare Function FindNextFile Lib “kernel32” Alias “FindNextFileA” _ (ByVal hFindFile As Long,
Thanks to the undocumented TlbInf32 library you can emulate the VB6 CallByName() function in VB5 too. First, add a reference to the “TypeLib Information” type library in your project. This
ADODataNav is an activex data navigational control disigned in and for Visual Basic that you can connect to an ADO MSData control giving you two usefull toolbars for navigation and
‘ build a list of all the individual words in a string” returns a collection that contains all the unique words.’ The key for each item is the word itself’
‘ evaluate the area of a triangle’ given its three sidesFunction TriangleArea(side1 As Double, side2 As Double, _ side3 As Double) As Double ‘ this function uses the Heron formula
‘ Returns an array with the first N prime numbers” Note: you can easily convert this routine to VB4 and VB5 by’ returning the result array through an argument instead
‘ Return True if a character belongs to a given catagory” CHARTYPE can be the sum of one or more of the following values’ 1 = Uppercase alpha char [A-Z]’
‘ convert from Celsius to Fahrenheit degreesFunction CelsiusToFahrenheit(ByVal value As Single) As Single CelsiusToFahrenheit = value * 1.8 + 32End Function’ convert from Fahrenheit to Celsius degreesFunction FahrenheitToCelsius(ByVal value As
Introduction As you have probably heard thousands oftimes, XML is a core technology in .NET. XML is a cornerstone of web services and ADO.NET recordsets (now calleddatasets) are internally stored
Private Declare Function LoadIconByID Lib “user32” Alias “LoadIconA” (ByVal _ hInstance As Long, ByVal lpIconName As Long) As LongPrivate Declare Function DrawIcon Lib “user32” (ByVal hDC As Long, _ ByVal
Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As LongEnd TypePrivate Declare Function GetObjectAPI Lib “gdi32” Alias
Private Type PICTDESC cbSize As Long pictType As Long hIcon As Long hPal As LongEnd Type Private Declare Function OleCreatePictureIndirect Lib “olepro32.dll” _ (lpPictDesc As PICTDESC, riid As Any, ByVal
‘ Move and resize a ProgressBar control so that it fits inside’ a StatusBar’s Panel.” The last argument is the panel index (one-based).Sub MoveProgressBarIntoPanel(pb As ProgressBar, sb As StatusBar, _
Private Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate Type PICTDESC cbSize As Long pictType As Long hIcon As Long hPal As LongEnd
Private Declare Function LoadStandardIcon Lib “user32” Alias “LoadIconA” (ByVal _ hInstance As Long, ByVal lIconID As Long) As LongEnum SystemIconConstants IDI_Application = 32512 IDI_Hand = 32513 IDI_Question = 32514 IDI_Exclamation
You probably use the Format function to format date, for example: ? Format(Now, “mm/dd/yyyy”) ‘ => 08/01/2001 ? Format(Now, “mm+dd+yyyy”) ‘ => 08+01+2001 It seems that this is everything you
Temporary objects, or unnamed objects, are created as a result of expressions requiring a temporary object or when the user instantiates them explicitly. If the temporary object is not bound
Suppose you need to convert a string containing a hexadecimal value to int. Although you can use a std::stringstream object for this purpose, it’s worth noting that good old C
std::istream and std::ifstream objects define the eof() member function which returns true when the stream object has reached the end of a file. Note that at least one read operation











