Results 1 to 3 of 3

Thread: Registering COMDLG32.OCX

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Posts
    106
    Fellow Programmers,

    Not to beat a dead horse, but...
    I have seen many, many methods of registering the COMDLG32.OCX or any other OCX for that matter. Can someone please provide me with what they feel is the shortest, most efficient and effective source code to accomplish this task. Your assistance and knowledge sharing is greatly appreciated! And thanks for your time.

    Steve

  2. #2
    Addicted Member
    Join Date
    Mar 2000
    Location
    Netherlands
    Posts
    128

    Try this

    I always use Regsvr32
    Remember Programmers don't sleep

  3. #3
    New Member
    Join Date
    May 2000
    Location
    Belgium
    Posts
    8

    Talking

    Found on this site


    How to register and un-register ActiveX Controls

    This tip describes how ActiveX controls can be registered and unregistered directly from Visual Basic. Every ActiveX control contains two functions that can be called that will instruct the OCX to either register or un-register itself with the system. These functions are DLLRegisterServer and DLLUnregisterServer. The following tip demonstrates how to register and un-register the Microsoft Common Controls OCX, ComCtl32.OCX.

    Declarations

    Copy the following code into the declarations section of your projects.

    Declare Function RegComCtl32 Lib "ComCtl32.OCX" _
    Alias "DllRegisterServer" () As Long
    Declare Function UnRegComCtl32 Lib "ComCtl32.OCX" _
    Alias "DllUnregisterServer" () As Long
    Const ERROR_SUCCESS = &H0

    Code

    To register the Microsoft Common Controls, use this code:

    If RegComCtl32 = ERROR_SUCCESS Then
    MsgBox "Registration Successful"
    Else
    MsgBox "Registration Unsuccessful"
    End If

    If UnRegComCtl32 = ERROR_SUCCESS Then
    MsgBox "UnRegistration Successful"
    Else
    MsgBox "UnRegistration Unsuccessful"
    End If

    Note: Each DLL function call may take up to 5 seconds.


    Software Engineer
    Using VB5 SP3

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