Results 1 to 4 of 4

Thread: VB6 .OCX file works, but not when I recompile (identical code)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2013
    Posts
    8

    VB6 .OCX file works, but not when I recompile (identical code)

    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.

    Please help!

    Let me know if you need any extra information and I'll reply ASAP.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: VB6 .OCX file works, but not when I recompile (identical code)

    In my signature is a link about binary compatibility for ActiveX components... sounds like what you need.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: VB6 .OCX file works, but not when I recompile (identical code)

    Yep, sounds like a binary compatibility issue

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 .OCX file works, but not when I recompile (identical code)

    Here is the relevant topic within the Debugging, Testing, and Deploying Components chapter of the Using Visual Basic manual: Version Compatibility in ActiveX Components.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width