Monday, August 23, 2010

Flash Control Error in VB6

There has been recent news about Adobe Flash Control causing problem in VB6 projects. The last version of flash which didnt had any problem with VB6 was Flash10e.ocx it seems all version after that are having the same problem.

Problem
When we try to save a form containing a flash control, VB6 shows an error message.
---------------------------
System Error &H80004005 (-2147467259). Unspecified error
---------------------------

If we open an old project which already have a flash control, there is no problem in saving or compiling the app as long as we dont open the form containing the flash control.

*Adding Flash Control or Adding any control to a form having a flash control
*Opening a form with flash control and/or changing property of existing control

And then trying to save it produces errors.

Solution
Downgrading to flash10e.ocx seems to fix the problem. Flash10f.ocx, Flash10g.ocx, Flash10h.ocx, Flash10i.ocx (the latest) all having the same problem. i tested all these controls.

Fortunately its not happening at runtime. And if it ever happens in the future then solution would be to use Reg-Free COM Manifest file and include the older version of Flash control with your application.

Step 1: Uninstall flash, we need to use the adobe flash uninstaller, because the flash installer leave a check in the registry and doesnt allow us to install an older version. so 1st uninstall flash using the instruction provided here

Step 2: Getting Old Version. oldapps.com has Flash10d.ocx installer, download version 10.0.42.34 from there OR Adobe provides old version of their player on this page, you need to download the fp10_archive.zip 157 MB zip file and then go to \10r45_2 folder to find flashplayer10r45_2_winax.exe which is the Flash10e setup.

fp10.1_archive.zip
\10_1r53_64 = Flash10h.ocx
\10_1r82_76 = Flash10i.ocx

fp10_archive.zip
\10r32_18 = Flash10c.ocx
\10r42_34 = Flash10d.ocx
\10r45_2 = Flash10e.ocx

Searching in Adobe forum here i found many people having the same problem. If someone see this blog post and have any solution then please suggest. Thanks!

Update: Sep 6, 2011.

These workaround dont require you to downgrade the control and will work on any flash version installed.

Workaround 1: For compiling existing application. If you have a multi-form application then you can safely compile the application If you dont open the form containing the flash control.

Workaround 2: Manual Edit method for adding flash control to new app. Add and code the flash control, then remove the control, then add a picturebox with same name as your flash control, then save and exit VB6 IDE. now open your VB Form in notepad and find the picturebox control replace the picturebox code with the code below, modify the top, left values and also other value you want to change.
ShockwaveFlashObjectsCtl.ShockwaveFlash Flash1
Height = 3615
Left = 360
TabIndex = 1
Top = 960
Width = 4815
_cx = 8493
_cy = 6376
FlashVars = ""
Movie = ""
Src = ""
WMode = "Window"
Play = "-1"
Loop = "-1"
Quality = "High"
SAlign = ""
Menu = "-1"
Base = ""
AllowScriptAccess= ""
Scale = "ShowAll"
DeviceFont = "0"
EmbedMovie = "0"
BGColor = "000000"
SWRemote = ""
MovieData = ""
SeamlessTabbing = "1"
Profile = "0"
ProfileAddress = ""
ProfilePort = "0"
AllowNetworking = "all"
AllowFullScreen = "false"
End
now move to top of the code and just below VERSION 5.00 add the following line.
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash10e.ocx"

save the file, start VB6 and compile your project (without opening the form).

Friday, August 20, 2010

Tools: Resource Hacker

Resource Hacker is a freeware utility to view, modify, rename, add, delete and extract resources in 32bit Windows executables and resource files (*.res). It incorporates an internal resource script compiler and decompiler and works on Win95, Win98, WinME, WinNT, Win2000 and WinXP operating systems.

[Homepage]

Tools: Installers

The Package & Deployment Wizard that comes with VB 6.0 for making setup for software is outdated and looks unprofessional. Here is the list of some alternatives.

InnoSetup
Powerful script based installer creator [Homepage]


ISTool
GUI front-end for InnoSetup [Homepage]


Nullsoft Scriptable Install System
Another script based installer from the creators of WinAmp [Homepage]

ClickTeam Install Creator
GUI based installer [Homepage]

Updated P&D Wizard
If you still want to use P&D wizard then JSWare provides an updated version of VB's P&D Wizard [Homepage]

Thursday, August 19, 2010

Tools: Right-click OCX Register

This registry file will add Register/UnRegister context menu to all OCX/DLL files so we can quickly register/unregister them without manually using regsvr32. A real timesaver.

[Download]

Thursday, August 12, 2010

How to Install VB6 on Windows 7, Windows 8, Windows 10

Here are the steps on how to Install Visual Basic 6.0 on Windows Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10. These Steps are valid for Both 32-Bit and 64-Bit versions.

Installing
  1. Use notepad and make a 0-byte file named 'msjava.dll' in C:\Windows\ to avoid the installation of MS Java
  2. Insert the CD or Open the folder containing VS6
  3. Right Click setup.exe > Run As Administrator
  4. Ignore the two Compatibility warnings by clicking 'Run Program' and continue the installation wizard until setup asks you to customize which components to install
  5. Click the 'Custom' button and uncheck components which you dont want to install. (like VC++, FoxPro. Dont uncheck Database Components)
  6. After Completing the installation, setup will prompt you to install MSDN Library, Install it if you wish, but its very helpful.
  7. Skip the installation of BackOffice, InstallShield etc
  8. Click Finish to complete the setup
  9. Now run VB6 for the 1st time. Right-click Visual Basic 6.0 shortcut from startmenu > Run As Administrator. This will setup all the registry entries.
  10. Close VB6 and Install Service Pack 6. Thats All!
  11. Restart Windows
Correctly Using VB6 On Windows 7, 8, 10

1. User Account Control (UAC)
VB6 needs to be run with administrator rights or it will not work correctly. For this, Turn-off UAC from the control panel.

Or

If you prefer not to Turn off UAC then set VB6 to open with Admin Rights.
For this
1. Right click VB6 shortcut > Properties > 'Open File Location'
2. Then right click 'VB6.EXE' > Properties > Compatibility Tab > Check 'Run this program as an administrator' > OK

This will make VB6 open with Admin rights.

2. Aero Theme Problem
If you are using Aero Theme then VB6 IDE will behave oddly when you resize/move controls on form, To fix this problem Check 'Disable Desktop Composition' in the compatibility Tab, like we did above. Alternatively, you can also move controls using keyboard, Shift + Arrow Keys to Resize controls, Ctrl + Arrow Keys to Move controls.

Enjoy!

Update:
1. Windows Vista, 7, 8, 10 does not support WinHelp Help files, so some of the control's context sensitive help will not work. You can download an add-on from Microsoft to display Helpfiles.

2. On Windows 8 / 8.1 some users are reporting error at the end of setup, to fix this problem uncheck 'Data Access' at the start of setup.

More
Click here for Official Support Statement for VB6 on Windows Windows 7, Windows 8.

Btw, Visual Studio .NET 2002, 2003 have serious compatibility problems with Windows Vista and 7, They dont even install or run properly. On the other hand VB6 continues to run perfectly on all windows version since Windows 95. That makes a total of Se7ven different versions of Windows!

Note: i found the msjava.dll tip in the VB Newsgroup.

Keywords: How to Install Installing VB6 Visual Basic 6 Visual Studio 6 64-Bit Error Problem

Friday, August 6, 2010

Old VB Site Archives

Collection of some VB Websites which are now closed, viewable using Internet Archive Wayback Machine.

Visual Basic MCI Command Post [Visit]

activevb.de Archiv-Project [Visit]

Paul's Visual Basic Code Examples [Visit]
Closed Site: http://www.syix.com/wpsjr1/

Hello

Would try to update this blog from now. many links are broken like platnet source code and many websites shutdown.