riaing events from ActiveX EXE back to calling app

Posted on 2005-04-08
Last Modified: 2010-05-02
I have an applciation with an MDI form and a bunch of child forms.

several of the child forms call a method in a separate ActiveX EXE.

I want the ActiveX EXE to raise an event that the MDI form will respond to - not the actual calling child forms.

Is there a way to do this?

I tried instantiating an object of the relevant class of the ActiveX EXE - WithEvents - but it didn't respond to the raised event

Here's the code is use to raise the event in teh ActiveX exe

RaiseEvent ProtectListUpdated(intCurrentlyUsedInKBytes, intAccountSizeInKBytes)

Question by:kenshaw
    1 Comment
    LVL 32

    Accepted Solution

    In your MDI Main form:

    Public Withevents objMyObj As YourProj.YourClass

    Then the events will be listed in the right dropdown box in the code pane after you select your object in the left dropdown box.  It will be something like:

    Private Sub objMyObj_ProtectListUpdated(ByVal kBUsed As Long, ByVal kBSize as Long)

    Each of the child forms can call methods in the EXE by calling it like:

    Call MDIForm1.objMyObj.MyFunction(bla, bla)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now