|
-
Jul 27th, 2019, 12:45 AM
#1
Thread Starter
Hyperactive Member
Re: initializing runtime in standard dll
 Originally Posted by jsvenu
Dear Trick,
Is there a way to initialize runtime and at the same time get the class object of the activex dll using vbdllgetclassobject so that we can call any methods of
the class and exported functions of activex dll.I can see that vbdllgetclassobject has last parameter as IClassfactory object.But how to get this object so that
we can call instance of the class of activex dll from this class factory.Can you clarify me with an example.Already yo have shown how to do this with dllgetclassobject
in InitProjectContextDll example.In all the examples you provided for multithreading the last parameter of vbdllgetclassobject was not used.
Therefore I request you to provide an example for getting the IClassfactory object using vbdllgetclassobject last parameter.
regards,
JSVenu
Dear Trick,
I solved the problem as follows:
I changed vbdllgetclassobject api declaration last parameter type from long to Any as follows:
Private Declare Function VBDllGetClassObject Lib "MSVBVM60.DLL" (gloaders As Long, gvb As Long, ByVal gvbtab As Long, rclsid As Long, riid As GUID, ppv As Any) As Long
Dim ofac As Object
VBDllGetClassObject hLib, U2, pVBHeader, aiid, IID_IClassFactory, ofac
Set m_cContext = ofac
Now everything works fine.
regards,
JSVenu
Last edited by jsvenu; Jul 27th, 2019 at 05:36 AM.
Reason: for providing vbdllgetclassobject last parameter type modification
-
Jul 27th, 2019, 05:40 AM
#2
Thread Starter
Hyperactive Member
Re: initializing runtime in standard dll
Dear Trick,
After obtaining m_cContext as above Can you tell me how to obtain m_cFactory and how to access a method say abc as follows in CInitContext of TestDll from DllUsage application of InitProjectContextDll project.
Sub abc() 'defined in CInitContext class
MsgBox "abc"
End Sub
regards,
JSVenu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|