2

People here use an old compiled VB program, the last version is 16 years old. It works on some machines but not on others, all with the same 1709 version and updates of Windows 10.

Where it does not work a message says either that msdatlst.ocx or msdatgrd.ocx is not registered. Then when I try to register with regsvr32 'MSDATGRD.OCX' there is a message "the module was loaded but the entry-point was not found". The same command is successful in the machines where the program works.

I did read some questions here but none of the answers solved it for me. Any ideas?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260
  • 1
    Run cmd.exe as an administrator and try regsvr32 "path_to_msdatgrd.ocx". – Smith Jan 14 '20 at 21:18
  • Also, try registering any other ocx or COM/ActiveX dll file. If the problem still persists try Process Monitor to troubleshoot it https://stackoverflow.com/questions/59463345/distributing-visio-addin-developed-in-vb6/59466130#59466130 If nothing helps, try with a small setup application for your ocx files. You could make it using Visual Studio or some setup tools like Setup Factory. – Smith Jan 14 '20 at 21:27
  • 4
    VB6 is 32 bit so you must use the 32 bit regsrv32 in `C:\Windows\SysWOW64` and as mentioned Run As Admin. –  Jan 15 '20 at 03:11
  • @Smith: Yes I did it as admin – Clodoaldo Neto Jan 15 '20 at 11:20
  • @Mark: Ah! Now I see that there are two versions of `regsvr32`. In my machine both are successfully executed. I will check in a machine where the program does not work. – Clodoaldo Neto Jan 15 '20 at 11:59
  • 1
    @Mark I thought the same at first, but then I read this other Q&A: https://stackoverflow.com/questions/18935163/registering-a-32-bit-dll-with-64-bit-regsvr32 Now I'm not sure. – StayOnTarget Jan 15 '20 at 13:14
  • Try creating a proper deployment package instead of manually copying stuff around and tweaking it. – Bob77 Jan 15 '20 at 16:16
  • It sounds like the ocx might be corrupt. I agree with Bob77 about using an install set to resolve this issue. But another option would be to copy a working ocx and trying to register it. – Brian M Stafford Jan 15 '20 at 18:23
  • @Brian: The two `ocx` come from the same server in all machines. – Clodoaldo Neto Jan 15 '20 at 18:36

2 Answers2

4

Thanks to @Mark's comment and all the others. The problem was indeed what version of regsvr32 was executed.

In the machines where it was possible to register the ocx the default version is at \windows\syswow64 and in those where that was not possible at \windows\system32. Then I did run the syswow64 one and the registration succeeded and the program now works.

Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260
0

Check if the .def file is specified, otherwise, the required DllRegisterServer function will not be exported.

Soyal7
  • 381
  • 5
  • 10