I am updating a program at work that uses a .ocx file to communicate with a database. The program works just fine with a version of the .ocx that was compiled a few months ago. However, if I try to compile a new version of the .ocx file, the program doesn't want to communicate with the database anymore.
My first thought was that something must be wrong in the code of the .ocx file. So I tried opening a backup of the .ocx project (which contains the same code as the working .ocx file) and compiled that. But that doesn't work either. Same code as the working .ocx, goes through the same registry processes during install, and yet it doesn't work.
I tried compiling more backups, all the way back to 2005, but none of the .ocx files work except the one I have that was compiled a few months ago.
Every time I recompile the .ocx file, I also register it with my program in the development environment and recompile the main program .exe file as well. The weird thing is, all the .ocx files that I compile from backups work when I run the program in my development environment. But as soon as I compile the main .exe file, move the files into the installer on another computer and install them, the program stops working properly.
So to summarize, I have a bunch of .ocx projects that will compile and work with my program in the development environment on the same computer. As soon as I move the files into the installer and install, the program stops working. I can get it to work with a .ocx file that I found from a few months ago, but when I try to compile the same project that produced that working file, the program doesn't work.
I tried pulling a .ocx file from a backup few years old without re-compiling (similar to what I did with the working copy), and that failed too. I can only get my installer to work with that one .ocx file from a few months ago. It can't be a problem with the code, since I tried compiling the original project of the working .ocx which has identical code. I don't think it's a registry issue, since all the files go through the same registry process during install.
At least I have a working installer (using the .ocx that I found) but now I'll never be able to make changes to the .ocx file, because everything I compile fails to work. I must be missing something, but I don't know what.
regsvr32 /u
unless you keep every OCX ever compiled on your dev machine, ever. – wqw