Cannot unregister OCX control 
Author Message
 Cannot unregister OCX control

I am getting an error trying to register or unregister an OCX control using
regsvr32.exe.

When trying to unregister an OCX control, I type the following at a command
prompt:

    regsvr32 /u /vbdatacontrol.ocx

And I receive the following error message:

    LoadLibrary("vbdbcontrol.ocx") failed.
    GetLastError returns 0x0000007e.

According to ID: Q238265  "This behavior occurs because the Olemsg32.dll and
Cdo.dll files are being called from the wrong installation point.  To
resolve this issue:  Copy the Olemsg32.dll or Cdo.dll file to the C:\Program
Files\Common Files\System\Mapi\1033\NT folder."

But I already have cdo.dll in the appropriate directory.

Does anyone know what could be wrong?

Thanks
Dave



Thu, 14 Nov 2002 03:00:00 GMT  
 Cannot unregister OCX control
Hello Dave,

Sorry for the long delay in getting you this response.

I'm not sure exactly what is causing the issue at this point.  I don't
think the article Q238265 is going to help us much as they seem to deal
specifically with registering either OLEMSG32.DLL or CDO.DLL.

The first thing I would try (if you haven't already) is to see if REGSVR32
can register another OCX.  Run...

     regsvr32 comctl32.ocx

..and see if you get the same error.

I'm not familiar with the OCX that you mentioned in your message,
VBDBCONTROL.OCX.  Is this a third party control or a control that you
created?  If you created it, was it created in VB or C?  Has there been any
success in registering that control on other machines?  How about
previously registering that same control on this machine...did that ever
work?

Some additional things to try is running the Dependency Walker tool.  In
VB6, there is a tool called Depends.EXE that you can run.  It can be found
under the Start menu on the Microsoft Visual Studio 6.0 Tools (or on the
CD).  From that program, open the OCX and you will see a list of all other
DLLs that it requires.  Verify that all DLLs that it requires are installed
and registered prior to registering this OCX.

Also, we might want to see what happens when manually calling the
LoadLibrary function.  Here is some sample code that calls the API.  Give
it a try and see if you get any errors.  Create a new project with one
command button and paste the following code (Be sure to change the path to
point to your OCX)...

   Private Declare Function LoadLibrary Lib "kernel32" Alias _
      "LoadLibraryA" (ByVal lpLibFileName As String) As Long

   Private Sub Command1_Click()
      Dim result As Long

      result = LoadLibrary("c:\winnt\system32\comctl32.ocx")

      'Check for error
      If result = 0 Then
         Debug.Print Err.LastDllError
      End If
   End Sub

Let me know how these tests go.

Eric Thrower
Microsoft Developer Support



Sat, 23 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. beans.ocx cannot be loaded, when you unregister and register the JavaBean as an ActiveX Component

2. ActiveX DLL Registration problem... Cannot unregister - Cross Posted

3. Unregister OCX's

4. Programmatically Unregister DLL and OCX

5. Some servers and ocx's won't unregister

6. How do I unregister .DLL and .OCX files?

7. Why don't my exe's and ocx's unregister

8. How to unregister the OCX from VB

9. How to unregister a missing ocx?

10. UNREGISTER OCX?

11. Register/Unregister dll/ocx using API calls

12. How do I unregister .DLL and .OCX files?

 

 
Powered by phpBB® Forum Software