CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2001
    Location
    Los Angeles, CA, United States
    Posts
    47

    Exit from DLL loop by the event generated in VB

    In my program(VB code), call dll procedure(coded by C).
    If click "stop" button in VB, must quit from the loop of DLL.
    How can detect in dll(c code) whether "stop" button is clicked in VB?
    In other words, even if control is passed to DLL, if VB generate some event, DLL must detect it?
    Could anyone who know let me know the way?
    Thanks.

    I'm a senior programmer.
    Working at CamSight, Dental imaging solutions industry.

  2. #2

    Re: Exit from DLL loop by the event generated in VB

    sample API DLL C-code:

    //function to export
    long __stdcall myloopingfunction();
    long __stdcall stopLoop();

    static boolean _loop_flg;

    long __stdcall myloopingfunction()
    {
    while(_loop_flg)
    {
    /*
    loop code
    for each loop U must call function to
    Executes all pending Windows events.
    (VB function DoEvents)
    */
    }

    return 0;

    }

    /* function to call in VB stop button */
    long __stdcall stopLoop()
    {
    _loop_flg = false;
    return 0;
    }

    hi brt


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