MFC dll calling outlook 2010 spawing multiple threads

This is a discussion on MFC dll calling outlook 2010 spawing multiple threads within the Windows Programming forums, part of the Platform Specific Boards category; Hi Everyone, I have been able to send an email using an MFC dll(32 bit) that would interface with outlook ...

  1. #1
    Registered User
    Join Date
    Sep 2013
    Posts
    6

    MFC dll calling outlook 2010 spawing multiple threads

    Hi Everyone,
    I have been able to send an email using an MFC dll(32 bit) that would interface with outlook 2010 (using 32 bit outlook). The MFC dll is implicitly linked to the mso.dll. I am using a native C application to send email using outlook and have been successfull (partially). I am using the LoadLibrary() and GetProcAddress() to access my MFC dll functions to handle sending the email. However, my application crashes when I try to exit the application. After investigating this further, I noticed that when my MFC dll connects to the outlook process, five additional threads are launched ( I assume because I am using CoInitialize()). These threads do not self terminate when I unload the mfc dll using FreeLibrary(), which is why my native C app is crashing on exit.
    I can brute force and terminate the app using exit(0), but I would like to understand how to handle these additional threads. I am new to multi -thread programming and I realize this is pretty vast subject and cannot be learned quickly. However, I would like any constructive input towards understanding how I can solve this issue.
    thanks in advance.

  2. #2
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    Show code.

    And I highly doubt that a DLL leaving threads around is making your program crash at all. It sounds entirely unrelated.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multiple Threads
    By NuNn in forum C Programming
    Replies: 3
    Last Post: 03-15-2009, 12:29 AM
  2. Replies: 6
    Last Post: 01-09-2007, 04:12 PM
  3. Outlook/Outlook Express .dbx files
    By dit6a9 in forum Windows Programming
    Replies: 1
    Last Post: 05-18-2005, 12:33 PM
  4. a point of threads to create multiple threads
    By v3dant in forum C Programming
    Replies: 3
    Last Post: 10-06-2004, 10:48 AM
  5. Replies: 8
    Last Post: 09-22-2003, 02:31 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21