Type GUID128
 ata1 As Long
 ata2 As Integer
 ata3 As Integer
 ata4(7) As Byte
End Type
Declare Function UuidFromString Lib "rpcrt4" Alias "UuidFromStringA" ( _
ByVal lpUUIDString As String, _
lpUUID As GUID128) As Long
Private Declare Function CoCreateInstance Lib "ole32" (rclsid As GUID128, pUnkOuter As Any, ByVal dwClsContext As Long, riid As GUID128, ppv As Any) As Long
Private Declare Function CLSIDFromString Lib "ole32" (ByVal lpsz As Long, pclsid As GUID128) As Long
Sub LoadDll(sObjectCLSID As String, sInterfaceIID As String)
Dim mObjectCLSID As GUID128
Dim mInterfaceIID As GUID128
'Определяем UUID'ы класса и интерфейса
Call UuidFromString(sObjectCLSID, mObjectCLSID)
Call UuidFromString(sInterfaceIID, mInterfaceIID)
' Создаем объект
If CoCreateInstance(mObjectCLSID, 0&, &H5, mInterfaceIID, 0) <> 0 Then
MsgBox "Неудалость инициализировать объект"
End If
End Sub
Public Sub LoadDll2(CLSSrting As String, IIDString As String)
Dim RetVal As Long
Dim RecordDisp As Object
Dim CLSID As GUID128
Dim IID As GUID128
CLSIDFromString StrPtr(CLSSrting), CLSID
CLSIDFromString StrPtr(IIDString), IID
MsgBox CoCreateInstance(CLSID, ByVal 0, &H5, IID, RecordDisp)
End Sub