adding a thread

Posted on 2004-11-08
Last Modified: 2013-11-20
Hi all,
  I am writing an addin .dll. I need to add another thread to my addin. How do I do this. The .dll uses mfc!

500 pts.
Question by:struggling_coder_3203
    LVL 55

    Expert Comment

    by:Jaime Olivares
    Don't worry about MFC, just have to create another thead with WinAPI CreateThread() function.
    Your function won't be a member of a MFC class (will be global) but still you can use any MFC object.

    LVL 86

    Expert Comment

    In general, I'd recommend ("Multithreading for Rookies") as a lecture regarding this issue. It comes with quite some sample code.

    Author Comment

    well, how would I do it with a class derived from CWinThread???
    LVL 86

    Accepted Solution

    Here's a good tutorial for that: ("Threads with MFC"). Bsically, you'd use

    UINT MyThreadProc( LPVOID pParam ) {

        // ...

    CWinThread* pThrd = AfxBeginThread(MyThreadProc,NULL);

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

    731 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

    16 Experts available now in Live!

    Get 1:1 Help Now