The Latest

DevX - Software Development Resource

Reading From an Excel File

Question: Is there a way to store data in an Excel file from an ADO recordset by doing some sort of block read/write instead of reading/writing every data field in

DevX - Software Development Resource

Date Subtraction

Question: I have a date field store in one of my database tables. How do I pull a record from that table within seven days of today’s date? today’s date

DevX - Software Development Resource

Using PL/SQL in VFP or SQL Server

Question: Can I use Oracle’s PL/SQL in Visual FoxPro or SQL Server 6.0? Answer: No. PL/SQL is a language native to Oracle, not Microsoft’s products. Each Microsoft database product has

DevX - Software Development Resource

DeleteRegistryValue – Delete a value from the Registry

Private Declare Function RegDeleteValue Lib “advapi32.dll” Alias _ “RegDeleteValueA” (ByVal hKey As Long, ByVal lpValueName As String) As LongPrivate Declare Function RegOpenKeyEx Lib “advapi32.dll” Alias “RegOpenKeyExA” _ (ByVal hKey As

DevX - Software Development Resource

GetRegistryValue – Read the value of a Registry key

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

DevX - Software Development Resource

CreateRegistryKey – Create a key in the Registry

Private Declare Function RegCreateKeyEx Lib “advapi32.dll” Alias _ “RegCreateKeyExA” (ByVal hKey As Long, ByVal lpSubKey As String, _ ByVal Reserved As Long, ByVal lpClass As Long, ByVal dwOptions As Long,

DevX - Software Development Resource

SetRegistryValue – Write a value in the Registry

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

DevX - Software Development Resource

DeleteRegistryKey – Delete a key of the Registry

Private Declare Function RegDeleteKey Lib “advapi32.dll” Alias “RegDeleteKeyA” _ (ByVal hKey As Long, ByVal lpSubKey As String) As Long’ Delete a registry key” Under Windows NT it doesn’t work if

DevX - Software Development Resource

GetRegisteredUser – Retreive the name of the registered user

Private Declare Function GetVersion Lib “kernel32″ () As LongConst HKEY_LOCAL_MACHINE = &H80000002′ Return the name of the registered user” Requires the GetRegistryValue functionFunction GetRegisteredUser() As String Dim regKey As String

DevX - Software Development Resource

Determining the Top Level Frame

Question: I have developed a custom AWT component that can be placed at any level in a component hierarchy. How can it determine the top level Frame in the hierarchy?

DevX - Software Development Resource

Enumerating Methods of a Class

Question: How can I enumerate the methods of an object? I know there must be away since JBuilder and other IDEs know how to populate a list ofmethods from a

DevX - Software Development Resource

Select All Checkboxes

Question: I have several checkboxes and I want one checkbox tocause all of the checkboxes to be selected when it is selected. Howcan I do this? Answer: Even though the

DevX - Software Development Resource

JPasswordField

Question: How do I access the contents of a JPasswordField to see if it matcheswith the correct password? Answer: Before using a class, it helps to examine all of the

DevX - Software Development Resource

SystemCalls

Question: Is there any method (MFC, Win32) to get the contents of the systemvariable “PATH”? Answer: Sure there is. Use the standard function getenv() for this purpose: #include { char

DevX - Software Development Resource

Mouse Click Coordinate

Question: I know how to detect a mouse click with a MouseListener, but how doI obtain the coordinates associated with the click? Answer: If you already know how to detect

DevX - Software Development Resource

Database Field Types

Question: How do I get a string representation of a database field using JDBCregardless of its type? In other words, I have to use the getInt(),getDate(), getString(), etc., to get

DevX - Software Development Resource

RE: Date Arithmatic in Java

Question: I previously asked a question that may not have been worded as clearlyas possible and you answered something slightly different from what Iwas looking for. I want to know

DevX - Software Development Resource

Enumeration Types

Question: Can you make an array of enumeration types?If so, how do you do it? Answer: Yes you can, and it is very simple: enum direction { Up, Down};direction arr[10];

DevX - Software Development Resource

InetAdress.getAllByName

Question: When I use InetAdress.getAllByName(String host) on my workstation,I get two IP addresses. One is for the LAN connection and the other isfor the dialup connection. I need to get

DevX - Software Development Resource

Produce Shrinking Text

Use this code to get the shrinking text effect?similar to the opening of Star Wars: ‘ Requires a Label and Timer on the formPrivate Sub Form_Load() With Me .BackColor =

DevX - Software Development Resource

Replace a String Within a String, Recursively

I recently needed a substring replacement function for inserting code into a module, by reading the code from a file. Unfortunately, in my case, commas are interpreted as delimiters, and

DevX - Software Development Resource

Cache Properties for Repeated References

If you have to reference a control’s property repeatedly, it’s better to assign the property to a temporary variable, then use that variable. This technique is called property caching. For

DevX - Software Development Resource

Force Slider to Specific Intervals

Try using a slider control in your UI if you’re tired of combo boxes. Users find this control intuitive to understand and operate. For example, you might use the slider

DevX - Software Development Resource

Sort Non-String Items in a ListView

Sorting ListView columns with numeric data can be a real pain. Nonstring sorting is possible with callbacks using custom comparison functions, but this method’s drawback is that the synchronization between