Atlanta Custom Software Development 

   Search        Code/Page

User Login



Forgot the Password?
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
» Regular Expr Tester
» Free Tools

IsComDll - Check whether a DLL is a self-registering COM server

Total Hit ( 1917)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article



Click here to copy the following block
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" _
  (ByVal Path As String) As Long
Private Declare Function GetProcAddress Lib "kernel32.dll" (ByVal hModule As _
  Long, ByVal ProcName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hModule As Long)

' Check whether a DLL is an COM self-registering server

Function IsComDLL(ByVal FileName As String) As Boolean
  Dim hModule As Long
  Dim procAddress As Long
  ' attempt to load the DLL
  hModule = LoadLibrary(FileName)
  If hModule <> 0 Then
    ' the DLL has been loaded
    ' get the address of the DllRegisterServer function
    procAddress = GetProcAddress(hModule, "DllRegisterServer")
    ' if non-zero then the function is there
    IsComDLL = (procAddress <> 0)
    ' free-memory
    FreeLibrary hModule
  End If

End Function

Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with, SQL Server and other MS technologies. He is, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )

Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.