Hi everyone.
This is quite simple project, which allows to view some information about libraries and PE-files:
Export;
Import;
Delay import;
For type libraries and PE which contains the type libraries:
Interfaces;
CoClasses;
Types;
Enumerations;
Aliases.
It requires Edanmo's OLE interfaces & functions (olelib.tlb) for the work.
Regards,
Кривоус Анатолий.
Private Sub mnuOpen_Click()
Dim ofn As OPENFILENAME, Out As String, i As Long
ofn.nMaxFile = 260
Out = String(260, vbNullChar)
ofn.hwndOwner = hWnd
ofn.lpstrTitle = StrPtr("Îòêðûòü ôàéë")
ofn.lpstrFile = StrPtr(Out)
ofn.lStructSize = Len(ofn)
ofn.lpstrFilter = StrPtr("Ïîääåðæèâàåìûå ôàéëû" & vbNullChar & "*.dll;*.ocx;*.exe;*.tlb" & vbNullChar)
If GetOpenFileName(ofn) Then
i = InStr(1, Out, vbNullChar, vbBinaryCompare)
If i Then Out = Left$(Out, i - 1)
LoadLib Out
End If
End Sub
Private Sub mnuOpen_Click()
Dim ofn As OPENFILENAME, Out As String, i As Long
ofn.nMaxFile = 260
Out = String(260, vbNullChar)
ofn.hwndOwner = hWnd
ofn.lpstrTitle = StrPtr("Îòêðûòü ôàéë")
ofn.lpstrFile = StrPtr(Out)
ofn.lStructSize = Len(ofn)
ofn.lpstrFilter = StrPtr("Ïîääåðæèâàåìûå ôàéëû" & vbNullChar & "*.dll;*.ocx;*.exe;*.tlb" & vbNullChar)
If GetOpenFileName(ofn) Then
i = InStr(1, Out, vbNullChar, vbBinaryCompare)
If i Then Out = Left$(Out, i - 1)
LoadLib Out
End If
End Sub
Can translate?
Code:
Private Sub mnuOpen_Click()
Dim ofn As OPENFILENAME, Out As String, i As Long
ofn.nMaxFile = 260
Out = String(260, vbNullChar)
ofn.hwndOwner = hWnd
ofn.lpstrTitle = StrPtr("Open file")
ofn.lpstrFile = StrPtr(Out)
ofn.lStructSize = Len(ofn)
ofn.lpstrFilter = StrPtr("Supported files" & vbNullChar & "*.dll;*.ocx;*.exe;*.tlb" & vbNullChar)
If GetOpenFileName(ofn) Then
i = InStr(1, Out, vbNullChar, vbBinaryCompare)
If i Then Out = Left$(Out, i - 1)
LoadLib Out
End If
End Sub
Just FYI if you want an updated alternative, my oleexp.tlb project is originally forked from olelib and apart from some bug fixes and sub/function changes, the original parts are unmodified, so can be substituted without change (you may need to do a find/replace of "olelib." to "oleexp." without the quotes).
This project runs with only one change besides unchecking olelib and checking oleexp in references, in LoadTypeInfo, StringFromGUID2 tAttr.iid, strGuid, 39 must use StrPtr(strGuid) instead.
Last edited by fafalone; Aug 22nd, 2023 at 11:37 AM.