I have no idea what you are trying to ask but...
Code:
Fun *p = NULL;
p.AllocThread(n);
I am guessing you are getting a compiler error here.
First, you say is is a pointer to nothing.
Then you try to access p (even though you just said it points to nothing) with the . operator.
Code:
Fun *p = new Fun();
???