CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 1999
    Posts
    1

    events from dynamic object



    Can anyone tell me how can I trap events from dynamic activex control object(object created using createobject() method) .

    Thanks in advance

    Nilanjan




  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: events from dynamic object



    Hi


    If you have a reference to your object set in the project then you should be

    able to declare it in the usual way :





    Private WithEvents mObj As XXX.XXX





    Set mObj = CreateObject("XXX.XXX")


    This will then set the reference to the object so that it can still get events.


    If you're declaring your object as


    Private X as Object


    Set X = CreateObject(......)


    Then there's no way for VB (or COM for that matter) to know anything about the

    events that it can raise.


    Another way would be for the external object to implement an interface so that

    you could have call back facilities inside the object.


    Regards


    Chris Eastwood


    CodeGuru - The website for developers

    http://www.codeguru.com/vb




  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    An old one that is still actual

    Back from deep.
    Nice to read from you, Chris
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured