cocos2d-x for windows 8

I have set up cocos2d-x for windows 8, and the new project can compile successfully. But the project breakdown immediately when it run.

I find the problem is it can’t load the resource “HelloWord.png”, so the resource point is null, and it breakdown.

Do you know how to solve it?

SOS!

I have the same problem! I’m newer with cocos.

剑 陈 wrote:

I have set up cocos2d-x for windows 8, and the new project can compile successfully. But the project breakdown immediately when it run.
>
I find the problem is it can’t load the resource “HelloWord.png”, so the resource point is null, and it breakdown.
>
Do you know how to solve it?

  1. Check out it is placed in $Project/Asset
  2. Check out it is added into project in vs? After that Check out the HelloWorld.png in vs right click —> properties—>Content—> Yes ?

Hi,
I checked all you comment and it’s all ok and here:

// add “HelloWorld” splash screen"
CCSprite* pSprite = CCSprite::spriteWithFile(“HelloWorld.png”);

pSprite returns null

Hi,

there’s a problem with each call of CreateFile2 when you read a file.
You have to change the dwShared parameter from 0 to FILE_SHARE_READ :slight_smile:

(see http://stackoverflow.com/questions/12152096/createfile2-returns-access-denied-error-in-windows-8)

I don’t know if there’s also some issues when you try to write a file…

Thierry

Hi,
Thanks so much. Finally I can solve with your indications. :slight_smile:

Yeah, taht’s the problem! It is already fixed on github,
see https://github.com/cocos2d-x/cocos2dx-win8/commit/d7376da56811534e12a7cd086cd0df69f0f86f0b
Thierry Costa wrote:

Hi,
>
there’s a problem with each call of CreateFile2 when you read a file.
You have to change the dwShared parameter from 0 to FILE_SHARE_READ :slight_smile:
>
(see http://stackoverflow.com/questions/12152096/createfile2-returns-access-denied-error-in-windows-8)
>
>
I don’t know if there’s also some issues when you try to write a file…
>
Thierry

Hi,
Thank you for help. I can solve the problem with your indications:D