Click here to Skip to main content
15,900,589 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalclick over a balloon tip Pin
Member 7044078-Dec-03 10:27
Member 7044078-Dec-03 10:27 
GeneralRe: click over a balloon tip Pin
Peter Molnar9-Dec-03 12:27
Peter Molnar9-Dec-03 12:27 
GeneralRe: click over a balloon tip Pin
Member 7044079-Dec-03 21:05
Member 7044079-Dec-03 21:05 
GeneralRe: click over a balloon tip Pin
Peter Molnar10-Dec-03 1:18
Peter Molnar10-Dec-03 1:18 
GeneralI want a function called on thread exit. Pin
8-Dec-03 9:39
suss8-Dec-03 9:39 
GeneralRe: I want a function called on thread exit. Pin
Robert Kuster8-Dec-03 13:14
Robert Kuster8-Dec-03 13:14 
GeneralRe: I want a function called on thread exit. Pin
Matthew Busche8-Dec-03 23:44
Matthew Busche8-Dec-03 23:44 
GeneralRe: I want a function called on thread exit. Pin
Peter Molnar9-Dec-03 12:21
Peter Molnar9-Dec-03 12:21 
A *.dll would perfectly suit your needs. What you have to do is:

1.Create a *.dll and export all the functions you want your users to call
2.Make sure that the global data (if any) that simultanious threads can access (i.e. if two or more users at a time call the same function) is protected with syncronization objects like Critical sections
3.If your user calls LoadLibrary, your DllMain gets called with DLL_PROCESS_ATTACH, do some initialization, maybe keep reference count of attached clients, when your user calls FreeLibrary your DllMain gets called with reason DLL_PROCESS_DETACH. This is the place to call your CleanUpFunction()

Summary: your user has only to call LoadLibrary on your *.dll, GetProcAddress on the function, and FreeLibrary to get detached from your lib.

Peter Molnar
GeneralRe: I want a function called on thread exit. Pin
Matthew Busche11-Dec-03 10:44
Matthew Busche11-Dec-03 10:44 
GeneralRe: I want a function called on thread exit. Pin
Matthew Busche11-Dec-03 11:08
Matthew Busche11-Dec-03 11:08 
GeneralERROR Pin
mitil203904823048-Dec-03 9:26
mitil203904823048-Dec-03 9:26 
GeneralRe: ERROR Pin
John M. Drescher8-Dec-03 9:30
John M. Drescher8-Dec-03 9:30 
GeneralRe: ERROR Pin
mitil203904823048-Dec-03 9:34
mitil203904823048-Dec-03 9:34 
GeneralRe: ERROR Pin
John M. Drescher8-Dec-03 9:38
John M. Drescher8-Dec-03 9:38 
GeneralRe: ERROR Pin
Christian Graus8-Dec-03 9:40
protectorChristian Graus8-Dec-03 9:40 
GeneralRe: ERROR Pin
John M. Drescher8-Dec-03 9:45
John M. Drescher8-Dec-03 9:45 
GeneralRe: ERROR Pin
Christian Graus8-Dec-03 9:38
protectorChristian Graus8-Dec-03 9:38 
GeneralRe: ERROR Pin
mitil203904823048-Dec-03 9:41
mitil203904823048-Dec-03 9:41 
GeneralRe: ERROR Pin
Christian Graus8-Dec-03 9:42
protectorChristian Graus8-Dec-03 9:42 
GeneralRe: ERROR Pin
mitil203904823048-Dec-03 9:45
mitil203904823048-Dec-03 9:45 
GeneralRe: ERROR Pin
mitil203904823048-Dec-03 9:52
mitil203904823048-Dec-03 9:52 
GeneralRe: ERROR Pin
Christian Graus8-Dec-03 10:57
protectorChristian Graus8-Dec-03 10:57 
GeneralRe: ERROR Pin
mitil203904823049-Dec-03 8:38
mitil203904823049-Dec-03 8:38 
QuestionHow to bypass Outlook 2002 Security Object Model Guard Pin
Kevin McFarlane8-Dec-03 6:14
Kevin McFarlane8-Dec-03 6:14 
GeneralQuestion: Serial Plotting Pin
foghorn8-Dec-03 5:42
foghorn8-Dec-03 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.