VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

How to dynamically invoke DCOM objects

Newsgroup Posting  (15 Submissions)   OLE/COM/DCOM/Active-X   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

Ever wished you could say
set c = createobject(server,myobj.myclass)
and have DCOM invoke the object on the specified server dynamically?.
This avoids having to configure which server a DCOM object should run
on each time you want to invoke the object (with the DCOMCNFG
utility). Plus you can run the same object on different servers
without running DCOMCNFG each time. [email protected] (Andrew Mayo)

API Declarations
'DCOM structures
Type SERV_STRUC
reserved1 As Long
ptrserver As Long
authinfo As Long
reserved2 As Long
End Type
Type MULTI_QI
piid As Long
pitf As Object
hresult As Long
End Type
Declare Function CLSIDFromProgID Lib "ole32.dll" (progid As Any, clsid
As Any) As Long
Declare Function OleInitialize Lib "ole32.dll" (ByVal nullptr As Long)
As Long
Declare Function CoCreateInstanceEx Lib "ole32.dll" (clsid As Any,
ByVal punkouter As Long, ByVal context As Long, server As SERV_STRUC,
ByVal nelems As Long, mqi As MULTI_QI) As Long
Declare Function VarPtr Lib "vb40032.dll" (x As Any) As Long
Declare Function GetComputerName Lib "kernel32" Alias
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Rate How to dynamically invoke DCOM objects (5(5 Vote))
How to dynamically invoke DCOM objects.bas

How to dynamically invoke DCOM objects Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters