I've determined that this is what I'm trying to accomplish, in a nutshell:
I want to be able to start a specific thread "fooThread" from any function "bar_1(), bar_2(), bar_3(), etc..." but each function is in a different .cpp source file, so I need to create a pointer in each bar() function that references to fooThread:
Bar_1.h
Code: Select all
#include "Pointers.h" <-- Centralized pointer class
class bar_1()
{
public:
Pointers *PL;
bar();
~bar(){};
};
Bar_1.cpp
Code: Select all
#include "Bar_1.h"
bar::bar()
{
// Blah blah blah
PL->fooThreadLink->SomethingFunction();
}
The pointer class looks like this:
Pointers.h
Code: Select all
//Proper ifndefs etc...
#include "fooThread.h"
class bar_1
class bar_2
class bar_3
class Pointers
{
public:
Pointers(){};
~Pointers(){};
fooThreadLink *fooThread;
};
//endif defs
And I can imagine you can guess what the fooThread code looks like.
The pointers are assigned in my OnInit() function of MainApp, along with the pointer class being created.
My question, is how do I go about creating a fooThread in any bar() function and doing whatever I wish with it?
I know this may seem a little confusing, but if any clarifications are required I'd be happy to do so, for the sake of fixing my problem...
thank you!