Results 1 to 3 of 3

Thread: ActiveX Control Registration (coded within VB)

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 1999
    Posts
    7

    Post

    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!

  2. #2
    New Member
    Join Date
    Sep 1999
    Location
    London
    Posts
    3

    Post

    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.

  3. #3
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281

    Post

    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">

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width