Results 1 to 30 of 30

Thread: initializing runtime in standard dll

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    356

    Re: initializing runtime in standard dll

    Quote Originally Posted by jsvenu View Post
    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

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    356

    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
  •  



Click Here to Expand Forum to Full Width