SiCrane is correct - it looks like you've got a pointer to an Extras object someplace that you started using without calling new on it, or something like that. Your code using the class should look like one of the following:
// Create the object on the stack (local, more or less short lifetime depending on where it is created)Extras foo;foo.Init(bar);// etc.// Create the object on the heap (can still exist after the creating function exits)// Note that, to create a new object as a pointer, you should use "new"Extras *pFoo = 0;pFoo = new Extras;pFoo->Init(bar);// etc.
Functions in C++ classes are called using a system called __thiscall, which means that all class member functions (except static functions) have a hidden parameter. This hidden parameter is turned into the "this" pointer that you can use inside the functions, and also tells the code how to find the instance of your class that the function should be working with.
If you do something incorrectly, like the following, you can get a bogus "this" pointer passed to your function, which will trip an access violation:
Extras *pBogus;pBogus->IWillProbablyCrash();
Note that you don't have to actually set the pointer to 0xbaadf00d yourself - the compiler, in debug mode, will fill your program's memory with that (and other special values) to help make it obvious when things are going wrong. Most likely this is what is going on in your program.
Static members (both variables and functions) are shared by all instances of your class, so there is no need for them to have a "this" pointer. This is why it's possible to have your program run correctly when certain members are static: if a class member function never accesses anything in the class that
isn't static, then it will never need the "this" pointer, so a bogus pointer won't ever be accessed, and there won't be a crash.
Hopefully that should make it a bit more clear as to what's happening in your code.