===== Visual Basic 6.0 Tips ===== * **Optimize string handling in VB6** - Part I: http://www.aivosto.com/vbtips/stringopt.html * **Fixing slow down when moving controls under Windows 7** - right click vb6.exe and click Properties, go under Compatibility and check Disable Desktop Composition. * **Error 0x80004005** trying to register vb6idemousewheeladdin.dll on Win 7: Create a batch file with the regsvr32 command, pointing to wherever the dll is, and execute the batch file as administrator by right-clicking on it from Explorer: \\ ''C:\Windows\System32\RegSvr32.exe "C:\users\xxxxx\downloads\VB6IDEMouseWheelAddin.dll"'' * **An Atan2(y, x) function** for Visual Basic 6.0 Pro: Function Atan2(ByVal y As Double, ByVal x As Double) As Double ' fixed 1/25/2013 D. Juges ' True = -1 ' False = 0 If x Then Atan2 = Atn(y / x) - (x < 0) * Pi ' x != 0 Else Atan2 = -Pi / 2 - (y > 0) * Pi ' x = 0 End If End Function ' Atan2() * **PictureBox.Line method slow under Windows 7:** The function //PictureBox.Line (x1, y1)-(x2, y2)// is quite slow when drawing on a visible Picture Box. Instead, draw on a non-visible Picture Box, then when done, copy the picture box as an image to a visible picture box with: VisiblePictureBox.Picture = HiddenPictureBox.Image * **Automation Error while trying to access the OLE registry** on Windows 7: Open the VB executable at "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE", right click and select Properties. In the Compatibility tab, select Windows XP compatibility mode and "Run this program as an administrator" (path is for 64 bits, but it works for 32 bit Windows 7 as well) * **“Object library not registered” when adding Microsoft Rich Textbox Control 6.0 (SP6)** The problem has been resolved by running the following in elevated command prompt: cd C:\Windows\System32\ regtlib msdatsrc.tlb This also helped with other older .ocx files, like Graph32.ocx and Threed32.ocx \\ - Ilya Kurnosov Apr 15 '13 at 14:51 \\ If there is no regtlib.exe in C:\Windows\System32, use this one C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe \\ – Bulletmagnet Apr 17 '14 at 10:04 \\