开发者

NTSVC.OCX issues on Windows 7

开发者 https://www.devze.com 2022-12-20 00:38 出处:网络
I have a VB6 Service that uses the standard NTSVC.ocx file to help manage all the NT service functions. The application has been running on Windows 2003 Server RC1 with no troubles. Our sales team ask

I have a VB6 Service that uses the standard NTSVC.ocx file to help manage all the NT service functions. The application has been running on Windows 2003 Server RC1 with no troubles. Our sales team asked if we could put this same application on a notebook that could be used as a live site demo. The only issue I am having is that the notebook is brand new, running Windows 7 and the manufac开发者_开发百科turer only has Windows 7 drivers for the devices.

There is no installer for this service. I manually load the ocx and supporting other dll's into the various Windows and System32 folder and then run regsvr32 from the command prompt to load the OCX. The service has a command line set of parameters to install and uninstall the service itself.

When I try to REGSVR32 the OCX I get the following error:

The module "C:\Windows\System32\ntsvc.ocx" failed to load. Make sure the binary is stored at the specified path or debug to check for problems with the binary or dependent .DLL files. The specified module could not be found.


One potential reason that might lead to your problem, is that the NTSVC.OCX is built with a fixed Base Address (in other words, the Image has been bound by the Linker with the /FIXED switch). Starting with Vista, the Windows Loader uses Address Space Layour Randomization (ASLR) mechanism.

Based on this ASLR feature the Windows Loader attempts to load the OCX component at another Base Address than the predefined one (the one hardcoded in the OCX image file). Since your OCX Address Base is hardcoded, the Loader will fail to load your OCX (which is technically just a DLL!).

See Snapshot below showing these fields of the NTSVC.OCX image using PeStudio:

NTSVC.OCX issues on Windows 7


I would first try Dependency walker. If that doesn't give you a clue as to what you need you may be SOL. Also you will have to run regsvr32 as an administrator so you should get the little UAC popup.


this ocx (an also other ocx such as vbwheelscollfix.dll) to register ist very easy. First Step: copy this OCX into the Folder C:\Windows\SYSWOW64 (on 32 bit, i suspect its SYSWOW32).

Second Step: Open a CMD with administrative rights.

Last Step: Now you can register / unregister the file from the SYSWOW path.


As ich said: in an administrative shell: regsvr32 C:\Windows\SYSWOW64\NTSVC.ocx did work for me. Note that \System32 did not work, as it gave me an error. It might work in a x86 environment, though.

I now have no errors in my project but did not try if it works properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消