Home > Software engineering >  ActiveXDLL free registration call, the method of how to get the IID name
ActiveXDLL free registration call, the method of how to get the IID name

Time:09-16

CreateObject (" Vbscript. Regexp ")
The reference class path is: TypeLibInfoFromFile (" * \ vbscript. DLL \ 3 ")
LoadObjectByID here and want to use the full path: vbscript. DLL
Here is a difficulty
IIDName="_" & amp; Trim (ClsName)
Here is added in front of the "I", is actually use "IRegexp
"With "_Regexp" after a while, with "IRegexp" after a while, I don't know what rule,

 
Dim pDll As Long 'record Dll to the final perfect release
Dim the Update As the Update. The Handle 'to instantiate objects
Set the Update=LoadObjectByName (App. Path & amp; "\ Update. DLL", "Handle", pDll) 'New Update. The Handle
If the Update Is Nothing Then Exit Sub
The 'Update & lt; - class methods in the
Set the Update & lt;=Nothing ' -- -- -- -- -- this is cannot little, otherwise there will be unexpected errors
UnLoadDll pDll '& lt; - release

In the module:
Option Explicit
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryW" (ByVal lpLibFileName As Long) As Long
Private Declare Function GetProcAddress call Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function CallAsmCode Lib "user32" Alias "CallWindowProcW" (ByVal pA FirstAsmCode As Long, As Long, ByVal pB As Long, ByVal pC As Long, lpD As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any Source, As Any, ByVal Length As Long)

Private AsmCode (94), the As Long

The Public Function LoadObjectByName (ByVal DllPath As String, ByVal ClsName As String, pDll As Long) As the Object
Dim pObj As Long, TLIAPP As Object, TLI As Object
Dim clsids As String, IID As String, IIDName As String

On Error GoTo Err

The Set TLIAPP=CreateObject (" TLI. TLIApplication ")
The Set TLI=TLIAPP. TypeLibInfoFromFile (DllPath)

IIDName="_" & amp; Trim (ClsName)

Clsids=TLI. GetTypeInfo (Trim (ClsName)). The GUID
IID=TLI. GetTypeInfo (Trim (IIDName)). The GUID

The Set LoadObjectByName=LoadObjectByID (clsids DllPath, IID, pDll)
The Set of TLI=Nothing
Err:
End the Function

The Public Function LoadObjectByID (ByVal DllPath As String, ByVal clsids As String, ByVal IID As String, pDll As Long) As the Object
Dim pObj As Long
Call InitAsmCode
PObj=CallAsmCode (AsmCode (20), StrPtr (DllPath), StrPtr (clsids), StrPtr (IID), pDll)
CopyMemory LoadObjectByID pObj& , 4 & amp;
End the Function

The Public Function UnLoadDll (pDll As Long As Long
Call InitAsmCode
UnLoadDll=CallAsmCode (AsmCode (79), pDll, 0, 0, 0)
End the Function

Private Sub InitAsmCode ()
If AsmCode (4) Then the Exit Sub
Dim pDll As Long

Kernel32 pDll=LoadLibrary (StrPtr (" "))
AsmCode (0)=GetProcAddress call (pDll, "LoadLibraryW")
AsmCode (1)=GetProcAddress call (pDll, "GetProcAddress call")
AsmCode (2)=GetProcAddress call (pDll, "FreeLibrary")
Call FreeLibrary (pDll)

AsmCode (4)=& amp; H476C6C44
AsmCode (5)=& amp; H6C437465
AsmCode (6)=& amp; H4F737361
AsmCode (7)=& amp; H63656A62
AsmCode (8)=& amp; H4C430074
AsmCode (9)=& amp; H46444953
AsmCode (10)=& amp; H536D6F72
AsmCode (11)=& amp; H6E697274
AsmCode (12)=& amp; H10067
AsmCode (13)=& amp; H0 & amp;
AsmCode (14)=& amp; HC00000
AsmCode (15)=& amp; H0 & amp;
AsmCode (16)=& amp; H6F4600
AsmCode (17)=& amp; H65006C
AsmCode (18)=& amp; H320033
AsmCode (19)=& amp; H0 & amp;
AsmCode (20)=& amp; H83EC8B55 'create the object function entry
AsmCode (21)=& amp; HE853D8C4
AsmCode (22)=& amp; H0 & amp;
AsmCode (23)=& amp; H6CEB815B
AsmCode (24)=& amp; H8D100010
AsmCode (25)=& amp; H105293
AsmCode (26)=& amp; H93FF5210
AsmCode (27)=& amp; H10001010
AsmCode (28)=& amp; H32938D50
AsmCode (29)=& amp; H52100010
AsmCode (30)=& amp; H1493FF50
AsmCode (31)=& amp; H8D100010
AsmCode (32)=& amp; H101C93
AsmCode (33)=& amp; HFF028910
AsmCode (34)=& amp; H101893
AsmCode (35)=& amp; H875FF10
AsmCode (36)=& amp; H101093FF
AsmCode (37)=& amp; HC00B1000
AsmCode (38)=& amp; H86840F
AsmCode (39)=& amp; H45890000
AsmCode (40)=& amp; H20938DFC
AsmCode (41)=& amp; H52100010
AsmCode (42)=& amp; H1493FF50
AsmCode (43)=& amp; HB100010
AsmCode (44)=& amp; H506674C0
AsmCode (45)=& amp; H52EC558D
AsmCode (46)=& amp; HFF0C75FF
AsmCode (47)=& amp; H101C93
AsmCode (48)=& amp; H558D5810
AsmCode (49)=& amp; H938D52D8
AsmCode (50)=& amp; H10001042
AsmCode (51)=& amp; HEC558D52
AsmCode (52)=& amp; HBD0FF52
AsmCode (53)=& amp; H8D3E75C0
AsmCode (54)=& amp; HFF52DC55
AsmCode (55)=& amp; H93FF1075
AsmCode (56)=& amp; H1000101C
AsmCode (57)=& amp; HD8558B50
AsmCode (58)=& amp; H8D54128B
AsmCode (59)=& amp; H6A50DC45
AsmCode (60)=& amp; HD875FF00
AsmCode (61)=& amp; HB0C52FF
AsmCode (62)=& amp; H8B1575C0
AsmCode (63)=& amp; H4D8BFC45
AsmCode (64)=& amp; H59018914
AsmCode (65)=& amp; H8BD18B51
AsmCode (66)=& amp; H52FF5112
AsmCode (67)=& amp; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related