April 23rd, 2010, 04:43 PM
lost in .OCX registration hell
I develop and maintain several VB6 applications used internally by my employer. All PCs (both my development machine and the users' workstations) run Windows XP. My normal procedure is to develop and test the application, and build an installation package (using the Package and Deployment Wizard), on my machine, and then at each user's machine do the following:
1. log on using a domain administrator account
2. uninstall any previous version of the application
3. run the installation package to install the new version of the application
4. copy the Start menu entries and desktop shortcut to \Documents and Settings\All Users, so that the application can be run by any user
5. test the new version of the application to ensure proper operation
Recently, I completed, tested and built the installation package for version 2 of a particular application. One of the significant changes in this version is the removal of a listbox control and its replacement by an MS FlexGrid control (this was necessary because the users require different items to appear in different colors, which doesn't seem possible with an ordinary listbox). In order to use the FlexGrid, I had to add MSFLXGRD.OCX to the Components... list on the Projects menu. After upgrading the six existing users to version 2, and installing it for a new seventh user, I've run into a problem I've never seen before. When I log into any of the users' machines using the same domain administrator login that I used to install the application, it runs normally. But when I log out and the machine's user logs back in, when they launch the application it always aborts with the following error as soon as the form containing the FlexGrid is opened:
Run-time error '339':
Component 'MSFLXGRD.OCX' or one of its dependencies not correctly registered: a file is missing or invalid
With the machine's user logged in, I attempt to manually register the control by opening a command prompt window, making \Windows\System32 the current directory and entering regsvr32 msflxgrd.ocx at the prompt, but that always generates this error:
LoadLibrary("msflxgrd.ocx") failed - Access is denied.
Of course, if I then log out the user and log back in with the domain administrator login, I can successfully use regsvr32 to register and unregister the control, and the application runs normally for me. I'd always thought that component registrations were system-wide, but this situation seems to call that into question. I've read elsewhere that this problem can be resolved by registering the control in the HKeyCurrentUser section of the registry instead of (or in addition to) the HKeyLocalMachine section, and that I can do so by using a registry script rather than (or in addition to) regsvr32 and/or the installation package, but I have no idea of how to do so.
I'd be most grateful if anyone knows how to resolve this problem, as I've now got a bunch of users who are effectively locked out of their application. Thanks in advance.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!