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 an COM self-registering server

Total Hit ( 2504)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article



Click here to copy the following block
<System.Runtime.InteropServices.DllImport("kernel32")> Shared Function _
  LoadLibrary(ByVal path As String) As Integer
End Function

<System.Runtime.InteropServices.DllImport("kernel32")> Shared Function _
  GetProcAddress(ByVal hModule As Integer, ByVal procName As String) As _
End Function

<System.Runtime.InteropServices.DllImport("kernel32")> Shared Sub FreeLibrary _
  (ByVal hModule As Integer)
End Sub

' 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
  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.