Help! I am attempting to register an ActiveX control from within VB as follows:

Declaration:

Declare Function RegMyControl Lib "MyControl.ocx" Alias "DllRegisterServer" () As Long

Then in code:

If RegMyControl <> &H0 Then 'an error has occured

The above only works if the ActiveX control is in the Windows, or in the Windows/System directories. VB seems to require a fixed string in the declaration for the Lib(rary).

Does anyone know how to do this if the ActiveX control is in another location?

Thanks!