
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.
In applications that cannot be recompiled (e.g., apps that are installed on a customer’s machine as binaries only), values of constants may change occasionally. For example, exchange rates and the
By default, std::cin ignores leading whitespaces when it reads input from the keyboard or file. For example, if you execute the following statement: char name[10];cin>>name; and the user enters the
If you ever wanted to enhance the VB6 IDE without writing your own add-in program, or doing any programming, then this addin is for you. It creates a ToolWindow with
Private Declare Function GetUrlCacheEntryInfo Lib “wininet.dll” Alias _ “GetUrlCacheEntryInfoA” (ByVal sUrlName As String, lpCacheEntryInfo As Any, _ lpdwCacheEntryInfoBufferSize As Long) As Long’ Check whether the file identified by the URL
‘ Get system information using Active Directory” Returns True if successfull” Returns the following information in its parameters’ ComputerName’ DomainName’ PDC Name’ UserName” NOTE: requires a reference to the Active
‘ Get a description of the processor using Active Directory” NOTE: requires a reference to the Active DS Type libraryFunction GetCpuDescription() As String Dim thisComputer As ActiveDs.IADsComputer Dim thisService As
‘ Add an URL to the IE’s favorites by sending a client side JavaScript to IE’ sURL is the URL that the link will point to’ sDescr is the description
Private Declare Function InternetGetConnectedState Lib “wininet.dll” (ByRef _ lpSFlags As Long, ByVal dwReserved As Long) As LongConst INTERNET_CONNECTION_MODEM = 1Const INTERNET_CONNECTION_LAN = 2Const INTERNET_CONNECTION_PROXY = 4Const INTERNET_CONNECTION_MODEM_BUSY = 8′ return
The VB IDE remembers most of the configuration settings that were active when you closed the previous session. However, the maximized status of child MDI windows (the code editor and
Often, while developing a system you want to debug it using System.out.println or System.err.println. When development is over you would like to send all those messages to file. The easiest
If you are writing an application in which you don’t know the class of an object until runtime, then you cannot use the new operator to instantiate the object. This
The assert macro can be used to detect errors as soon as they occur. This macro is defined in the include file , and is used that way: assert (expression)
Use the following code: Public Function IsLeapYear(iYearToCheck As Integer) As BooleanIsLeapYear=IsDate(Format(
Put the control(s) in a frame and disable the frame. This will even eliminate graying out or color changes.
In C++, this can be achieved by throwing an exception from your Constructor. Since Constructors cannot return a value, this is the only way to achieve error handling. Class MyClass{
This User Control is designed to fit the needs of the coder who needs a date entry field without the overhead of having to ship (and install) the Microsoft Windows
If your program uses the WebBrowser control or any Microsoft Internet Control, you must ensure (and clearly specify in your app’s documentation) that the program can only work on systems
A simple way to add some pizazz to your forms is by minimizing them and then closing them, instead of making them disapper istantaneously. Just try this code: Private Sub
Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Const WM_USER As
In some cases you might want to activate a form given its name, but VB doesn’t let you do it directly. However, it is easy to create a function that
Copying and pasting text and images programmatically isn’t difficult at all, using the methods of the Clipboard object. However, implementing a generic Edit menu that copies and pastes the highlighted
If a form contains a RichTextBox control and other controls that are capable to receive the input focus, when the focus is on the RichTextBox and the user presses the
This was my first time in Stockholm, and was literally fascinated by this Northern capital, by its old town, with its narrow streets crowded with people (and tourists) and its
Download the source code for this article Over the last year or two,quite a few articles and books have been written on COM+, transaction managementand programming stateful & stateless components,
‘ Open a single pane Explorer window’ sRoot is the root folder to open’ bUpwardAllowed specifies whether the user will be allowed to navigate ‘ upward the root” Example:’ OpenSinglePaneExplorer
Private Type PRINTER_INFO_2 pServerName As String pPrinterName As String pShareName As String pPortName As String pDriverName As String pComment As String pLocation As String pDevMode As Long pSepFile As String
Private Declare Function SetFileAttributes Lib “kernel32” Alias _ “SetFileAttributesA” (ByVal lpFileName As String, ByVal dwFileAttributes As _ Long) As Long’ Associate an icon to a folder, by creating a desktop.ini
‘ Load the specified REG file in the registryPrivate Sub ApplyRegFile(ByVal sRegFile As String) On Error Resume Next ‘first of all, check if the file exists If Not (GetAttr(sRegFile) And
Private Const HKEY_CLASSES_ROOT = &H80000000Private Const HKEY_CURRENT_CONFIG = &H80000005Private Const HKEY_CURRENT_USER = &H80000001Private Const HKEY_LOCAL_MACHINE = &H80000002Private Const HKEY_USERS = &H80000003’Save the specified registry’s key and (optionally) its subkeys to
Private Declare Function RegOpenKeyEx Lib “advapi32.dll” Alias “RegOpenKeyExA” _ (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, _ ByVal samDesired As Long, phkResult As Long) As









