wxWidgets project problem adding resources

All questions regarding Windows programming, post here. API,COM, ActiveX, DirectX, OpenGL, MFC and so on...

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

wxWidgets project problem adding resources

Postby syd91 » Mon Aug 10, 2009 5:12 pm

needing help with a wxWidgets project I'm doing. Everythings been fine and dandy up until the point where I've had to start using resources after that... well that's why I'm here lol.

Problem:
the code compiles with no errors but when I run the program it shows a list of errors (around 17, 3 of them being in my code) I've tinkered with it to get to the main source of the problem. It can't load the resources and it tells me to check my .rc files. I'm a COMPLETE Noob to using resources in visaul c++ 2008 express edition.

any help is appreciated!!

Pics
1st one is the list of errors (erors.png)
2nd one is after I've tinkered with it that shows the main problem (almost.png)

Code
if need be to take a look at the code I've got it all copied down on a notepad file
Attachments
Evil Monkeys.txt
(23.32 KiB) Downloaded 77 times
almost.png
almost.png (47.52 KiB) Viewed 622 times
erors.png
erors.png (178.12 KiB) Viewed 618 times
syd91
 
Posts: 2
Joined: Mon Aug 10, 2009 4:11 pm

Re: wxWidgets project problem adding resources

Postby MXP » Mon Aug 10, 2009 5:34 pm

Post the code to a minimal example showing the problem and we can work through it.
Need information on a function I've posted? Chances are it's at the MSDN.
MXP
 
Posts: 6506
Joined: Mon Sep 22, 2003 5:27 pm

Re: wxWidgets project problem adding resources

Postby syd91 » Mon Aug 10, 2009 5:53 pm

okay the problem lies in the drawengine and app

Code: Select all
void DrawEngine::createBackgroundTile(int index,wxBitmap *tile)
{
   if (index >= 0 && index <= 16)
   {
      
      wxImage img = tile->ConvertToImage();
      img.SetMaskColour( 255, 255, 255);
      
      tileImage[index];
   }
   
}

...

int DrawEngine::createSprite(int index, wxBitmap *sprite)
{
   if (index >= 0 && index <= 16)
   {
      wxImage img = sprite->ConvertToImage();
      img.SetMaskColour( 255, 255, 255);

      spriteImage[index];

      return index;
   }
   return -1;
}


and this part in the app.cpp
Code: Select all
   
                drawArea.createBackgroundTile(TILE_EMPTY, &wxBITMAP("ETILE", wxBITMAP_TYPE_BMP));
   drawArea.createBackgroundTile(TILE_WALL, &wxBITMAP("TILE", wxBITMAP_TYPE_BMP));

   drawArea.createSprite(SPRITE_PLAYER, &wxBITMAP("PLAYER", wxBITMAP_TYPE_BMP));
   drawArea.createSprite(SPRITE_FIREBALL, &wxBITMAP("FIREBALL", wxBITMAP_TYPE_BMP));
   drawArea.createSprite(SPRITE_ENEMY, &wxBITMAP("ENEMY", wxBITMAP_TYPE_BMP));

   drawArea.setWindow(backBuffer, LEVEL_X, LEVEL_Y);

   level = new Level(drawArea, LEVEL_X, LEVEL_Y);
   player = new Mage(level, drawArea, 0, 0, 0, 3, ' ', 'w', 's', 'a', 'd');


I'm off to go arrage the code a bit.
syd91
 
Posts: 2
Joined: Mon Aug 10, 2009 4:11 pm


Return to Windows Programming

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests