-
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!
-
As far as I know, there is no way to do this - you may be able to set the default system directory using an API call, but this would lead to the almost certain death of your OS.
What ya wanna do, is move the control into c:\win\sys, and then call the API.
-
Try this:
Declare Function RegMyControl Lib "c:\path\to\myControls\MyControl.ocx" Alias "DllRegisterServer" () As Long
It just may work <IMG SRC="http://216.167.2.32/ubb/smile.gif">