How CCDirector::sharedDirector()->getWinSize() give different value in different function???

Hi All Champs,

Actually I am new in Cocos2d-x…So sometime may be my question was silly…For that really sorry
Now come to point.
//In .h
CCSize windowSize;

//In .cpp

function A (){
windowSize = CCDirector::sharedDirector()->getWinSize();
———//Do some other work
CCLog(“width = f, height = f”, windowSize.width, windowSize.height);//Give correct value
}

function B (){

--------Do some other work
CCLog(“width = %f, height = %f”, windowSize.width, windowSize.height);//Give correct value
}

function C (){

--------Do some other work
CCLog(“width = %f, height = %f”, windowSize.width, windowSize.height);//Give 0,0 value wrong
}

How this happened?
Please anybody explain me on what basis these value change?
Thanks Always….

windowSize a member variable of your class.
It keeps the same until some codes modify it.
Engine doesn’t know it any all.
So some of your logic codes modify it.
You can search “windowSize” in your codes, and check where modify it.

No windowSize was not modify in my code…I checked it very carefully
But one thing is that windowSize give garbage value after given below scenario.
Before schedule a function it give correct value Is it possible value changed after get back from schedule function???

Did you invoke “windowSize = CCDirector::sharedDirector()->getWinSize()” many times?
What platform did you test?
How to reproduce it?

Here are the scenario-

I defined windowSize = CCDirector::sharedDirector()->getWinSize()in each class, CCSize windowSize as a global variable.
When I schedule a function from one class to other class it give me garbage value, before calling this function it give right value.
I am using Win-XP.
For reproduce just define windowSize = CCDirector::sharedDirector()->getWinSize() in two different class, then call a function with schedule then check the value.

I don’t understand your meaning fully, may be you can modify HelloWorld and paste the codes.
Thank you.