C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-05-2007, 04:17 AM   #1
Registered User
 
Gordon's Avatar
 
Join Date: Apr 2007
Posts: 147
icon draw app

Hello
I have got a programme which seems to have one erron which I cant find, can you help me with it?

Code:
//-----------------------------------------------------------------
// Game Skeleton Application
// C++ Source - Skeleton.cpp
//-----------------------------------------------------------------

//-----------------------------------------------------------------
// Include Files
//-----------------------------------------------------------------
#include "Skeleton.h"

//-----------------------------------------------------------------
// Game Engine Functions
//-----------------------------------------------------------------
BOOL GameInitialize(HINSTANCE hInstance)
{
  // Create the game engine
  _pGame = new GameEngine(hInstance, TEXT("Game Skeleton"),
    TEXT("Game Skeleton"), IDI_SKELETON, IDI_SKELETON_SM);
  if (_pGame == NULL)
    return FALSE;
  
  // Set the frame rate
  _pGame->SetFrameRate(15);

  return TRUE;
}

void GameStart(HWND hWindow)
{
  // Seed the random number generator
  int srand(GetTickCount());
}

void GameEnd()
{
  // Cleanup the game engine
  delete _pGame;
}

void GameActivate(HWND hWindow)
{
  HDC   hDC;
  RECT  rect;

  // Draw activation text on the game screen
  GetClientRect(hWindow, &rect);
  hDC = GetDC(hWindow);
  DrawText(hDC, TEXT("Activated!"), -1, &rect,
    DT_SINGLELINE | DT_CENTER | DT_VCENTER);
  ReleaseDC(hWindow, hDC);
}

void GameDeactivate(HWND hWindow)
{
  HDC   hDC;
  RECT  rect;

  // Draw deactivation text on the game screen
  GetClientRect(hWindow, &rect);
  hDC = GetDC(hWindow);
  DrawText(hDC, TEXT("Deactivated!"), -1, &rect,
    DT_SINGLELINE | DT_CENTER | DT_VCENTER);
  ReleaseDC(hWindow, hDC);
}

void GamePaint(HDC hDC)
{
}

void GameCycle()
{
  HDC   hDC;
  HWND  hWindow = _pGame->GetWindow();

  // Draw the skeleton icon at random positions on the game screen
  hDC = GetDC(hWindow);
  DrawIcon(hDC, int rand() % _pGame->GetWidth(), rand() % _pGame->GetHeight(),
    (HICON)(WORD)GetClassLong(hWindow, GCL_HICON));
  ReleaseDC(hWindow, hDC);
}
The compiler says that the eror is : L.77 parse error before '('
I dont know before which bracket shoud I be looking at.

Windows XP
Dev-c++

Thx for replies
Gordon is offline   Reply With Quote
Old 04-05-2007, 04:24 AM   #2
ZuK
Registered User
 
Join Date: Aug 2005
Posts: 1,303
Code:
DrawIcon(hDC, int rand() % _pGame->GetWidth(), rand() % _pGame->GetHeight(),
Remove the int.
Kurt
ZuK is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Draw a semi-transparent icon in winapi. diskdisk Windows Programming 4 07-18-2009 12:08 PM
How can I get C#'s default window icon into my C++ app? dxfoo C++ Programming 1 02-26-2006 06:29 PM
best program to start gooddevil Networking/Device Communication 4 05-28-2004 05:56 PM
Console App & Systray Icon GaPe Windows Programming 3 06-14-2003 05:08 AM
icon in title bar? Unregistered Windows Programming 3 12-12-2001 06:43 PM


All times are GMT -6. The time now is 07:41 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22