devxlogo

Tip Bank

Create C++ DLLs to be Used in VB Apps

Some C++ programmers develop Win32 API DLLs that can used from Visual Basic programs. Use the __stdcall prefix with functions exported from the C++ DLL that you want to access

Move the Cursor to the Center

Use this simple subroutine to move the mouse/cursor to the center of an object. It’s useful for tab-like functions and default settings: Private Declare Function SetCursorPos& Lib _ “user32” (ByVal

Assure Compatibility

When working with ActiveX DLLs, many VB programmers build a reference DLL first, copy it to a subdirectory of the project directory, and set version compatibility to binary with a

Never Store Arrays of Objects in an auto_ptr

The Standard Library’s auto_ptr class template automatically destroys an object that is allocated on the free store when the current scope is exited. For example: #include //definition of auto_ptr#include using

Add a Hyperlink Listener in Java

To add a hyperlink listener in Java, add it to the JEditorPane and set its contents. A lot of errors may be thrown, but this is how the hyperlink listener