Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Visual Basic (Classic) FAQ

ActiveX DLLs

Tired of Error 429 - Self Register it in your app by zarkon4
Posted: 15 Jan 04

Found this useful little hint on Microsoft's site and I have encountered this problem and have seen posts from people who have as well.

The following is code in which you can automatically register your DLL or OCX at runtime, It has proven useful in the environment in which I develop. The code would go into your application.

Whenever you register or unregister a DLL the regsvr32 utility just calls out a function from withing the DLL itself. You may also use "DllUnRegisterServer" declared as a function as well.

Declare Function RegMyDLL Lib "<Path>\MyDLL.DLL" Alias _
              "DllRegisterServer" () as Long

private sub TestForDLL

On Error goto ErrorHandler

      dim RegMyDLLAttempted as Boolean
      dim objSomeObject as Object
      'if the dll is not registered then it will generate
      ' an error 429 at the following line.
      set objSomeObject = CreateObject("MyDLL.Class")

      set objSomeObject=nothing

      exit sub

      If err.number=429 then
          if RegMyDLLAttempted then
               'error in registering do something else
          end if

end sub

Back to Visual Basic (Classic) FAQ Index
Back to Visual Basic (Classic) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close