Error in registering ocx in Windows 7 64 Bit RRS feed

  • Question

  • I have been working on a Project, where I created my own ocx application Validate.ocx on Windows XP 32 bit in Visual C++ 6.0. Now I ported the same ocx application to Visual studio 2008(VC9.0) in Windows 7 64Bit envoirnment. I did this porting with the conversion tool of VC9.0. Now the release build of ocx is registering successfully with regsvr32.exe command, But giving error with debug build of ocx.

    When I try to register the ocx it gives the following error message: "The module "Validated.ocx" failed to load. Make sure the binary is stored at the specific path or debug it to check for problems with the binary or dependant .DLL files. The specified module could not be found."

    The command which I am putting to register is"%systemroot%\SysWoW64\regsvr32.exe Validated.ocx" from command prompt with "Run as Administration"

    Then I checked with the dependency Walker tool it is showing issues in 4 dependent DLLs:

    1. GPSVC.DLL


    3. MSVCR90.DLL

    4. MSVCR90D.DLL

    "Error opening file. The system cannot find the file specified" this message is displayed in fornt of these 4 Dlls.

    When I searched in my machine last 2 dlls are present inside "C:\Windows\winsxs\" path.

    Please show my any way how to register my debug build ocx file in Windows 7 64 Bit.

    Thursday, August 16, 2012 10:04 AM

All replies

  • Hi MayankAg,

    Welcome to the MSDN forum.

    Based on my understanding, you have created an ocx application, Validate.ocx, on Windows XP 32-bit; then, you want to port the same ocx application in Windows 7 64-bit environment. Maybe your original application is not compatible for Windows 7 64-bit environment.

    I suggest you re-complier your project in 64-bit project platform configuration and generate a 64-bit application; then, port the new 64-bit application and try again.

    I hope my suggestion will help.


    Elegentin Xie [MSFT]
    MSDN Community Support | Feedback to us

    Friday, August 17, 2012 2:08 AM
  • I suggest you re-complier your project in 64-bit project platform configuration and generate a 64-bit application; then, port the new 64-bit application and try again.

       Thanks Elegentin Xie,

           As I understood Where I need to re compile the project in 64-Bit project platform configuration, in Windows XP or Win 7?  And My application is also a 32 Bit application.  

    Thanks & Regards, Mayank Agarwal

    Tuesday, August 21, 2012 7:12 AM
  • Hi,

    Welcome back.

    Sorry for the belated response. I mean you need to re-compile your project and generate an x64 bit application.

    Here is a link about how to generate an x64 bit application from an x86 bit project: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/3eecb62e-34e5-4fae-a5ad-29e30b9fe63d

    If you have any more questions, please feel free to let me know.


    Elegentin Xie [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, August 28, 2012 9:27 AM
  • Is VS2008 installed on the machine you are attempting to register the OCX on? MSVCR90D.DLL indicates that your OCX has a dependency on the debug version of the CRT, and the debug version of the CRT and MFC librarys are installed with VS 2008.

    This post in the vsexpress forum, seems to cover this scenario pretty well.


    Ed Dore

    Wednesday, August 29, 2012 2:37 AM
  • My actual issue is, that i am unable to register a 32-bit ocx of debug build in a 64-bit OS(Windows 7).

    When I register my 32-bit debug mode ocx file in Windows 7 64-bit OS, it gets registered successfully.  When I register my ocx from C:\Windows\SysWOW64\cmd.exe using the command "regsvr32.exe",a the  confirmation dialog box pops up saying "DllRegisterServer in validate.ocx succeeded" and after clicking "OK', the following crash appears.

    Thanks & Regards, Mayank Agarwal

    Wednesday, August 29, 2012 6:52 AM
  • The easiet way to find out what went wrong is debugging your OCX during registration, this can be done very easy since you cna select regsvr32 directly in the debug options of VC.
    Wednesday, August 29, 2012 11:48 AM
  • My actual issue is, that i am unable to register a 32-bit ocx of debug build in a 64-bit OS(Windows 7).

    You haven't answered Ed's question. Is Visual Studio 2008 installed on the target machine? That's the only way to ensure that the debug libraries are installed correctly, since they are not redistributable.

    Have you successfully registered the RELEASE version of your ocx?

    Wednesday, August 29, 2012 3:05 PM
  • Hi Brian,

        Yes Visual studio 2008 with Service Pack 1 is installed in target machine.

    And RELEASE version is also registering successfully without any problem.

    The problem is only occuring in Debug version.

    Thanks & Regards, Mayank Agarwal

    Thursday, August 30, 2012 6:21 AM
  • Hi,

    I have the exact same problem here: unable to register the debug build, but the Release build registers just fine. Depends.exe was unable to find a few debug DLLs from the VS distribution, so I copied them manually in the OCX folder until Depends was satisfied. Still, it did not register either with VS's "register output" or manually with regsvr32.

    sxstrace tells me:

    ERROR: Cannot resolve reference Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762".
    ERROR: Activation Context generation failed.

    Why is it looking for VS 2005 DLLs?

    My setup is Windows 7 x64 with VS 2008 SP1. I'm pretty sure it worked fine on XP x86... any help would be appreciated.



    • Edited by ewhittom Monday, September 3, 2012 8:06 PM
    Monday, September 3, 2012 8:00 PM
  • Hi,

    This validate.ocx is a dialog based application. On executing this ocx with a sample application, the dialog box is not getting invoked. After using Spy++ tool (which comes with VC 9.0 package), I came to the conclusion that OnInitInstance() of the App Class is getting called. However, the OnInitDialog() of Dialog class is not getting called.

    This might be the reason for the dialog box not getting displayed.

    However, the unported validate.ocx works fine with the same sample application.

    What could be the reason?

    Please suggest a solution for the same.

    Thanks and Regards,

    Mayank Agarwal.

    Thanks & Regards, Mayank Agarwal

    Wednesday, September 5, 2012 5:29 AM
  • Did you used any third party lib files. If so it should be also 64 bit.

    Thanks, Renjith V R

    Wednesday, September 5, 2012 6:15 PM
  • No  I am not using any third party library files. And my ocx is a 32 bit application. Only the OS which I am using is Windows 7 64 Bit. and its a COM DLL which I have renamed it to ocx in my environment.

    And the sample application (.exe) is only using its(validate.ocx) CLSID inside  a function:



    "529132A4-EEC3-4C34-B5AC-075955C58788" this is the CLSID which get created in registry after registering a dll by "Regsvr32 command".

    And this function is failing.

    Please help in this regards.

    Thanks & Regards, Mayank Agarwal

    Thursday, September 6, 2012 6:56 AM