
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