Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6584875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:35:31+00:00 2026-05-25T16:35:31+00:00

I have created an abstract base class to allow for multiple implementation of a

  • 0

I have created an abstract base class to allow for multiple implementation of a task, which can be called generically via MFC dialog. This task needs to be able to be interrupted if the user clicks cancel.

abstract_dll.h:

class abstract_dll
{
public:
    virtual void my_task(CFeedback *fb)=0;
}

Where CFeedback is an abstract class to control user feedback (ie. progress bar)

concrete_dll.h:

class concrete_dll 
{
    virtual void my_task(CFeedback *fb)
    {
        //do some work
        //step progress bar
        boost::this_thread::interruption_point();

        //do some work
        //step progress bar
        boost::this_thread::interruption_point();
    }
}

extern "C" abstract_dll* get_class() { return new concrete_dll(); }

Now within the MFC Dialog I load the appropriate concrete_dll and initialize my abstract_dll *dll = module->get_class();

Then start a new boost::thread which calls the dll->my_task(fb);

Then when I call thread.interrupt(). The thread is never interrupted, and it never excepts at my interruption_points. I have traced the thread ID it is the same until we’re in the concrete_dll implementation, then I just get 0x0000 for the thread id.

Any thoughts? PS. The code above is just pseudo code for what I have. My actual code compiles and runs, I just can’t get it to interrupt.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:35:32+00:00Added an answer on May 25, 2026 at 4:35 pm

    I think the answer to your question is here:

    http://lists.boost.org/boost-users/2010/01/55171.php

    In short: you need to link to DLL version of boost:threads both in your project and DLL. Just put the:

    #define BOOST_THREAD_USE_DLL
    

    before <boost/thread.hpp> inclusion (or in the project propeties)

    BR

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an abstract base class Animal which has public virtual abstract method
I have an abstract base class called Person with subclasses Employee and Customer. How
In a C# program, I have an abstract base class with a static Create
I have a collection of classes that inherit from an abstract class I created.
I have an abstract base class with a TcpClient field: public abstract class ControllerBase
Here's the situation. I have a base class which implements a method that accepts
I have a class which is not thread safe: class Foo { /* Abstract
In my application I have a mapping like this @MappedSuperclass public abstract class Base
Our architecture uses the Repository pattern extensively. We have an abstract base class for
Lets say I have an abstract base class with a pure virtual that returns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.