IonicWind Software

Aurora Compiler => Coding Help - Aurora 101 => Topic started by: pistol350 on July 03, 2007, 05:09:11 AM

Title: problems with class
Post by: pistol350 on July 03, 2007, 05:09:11 AM
Hi all!
The compiler returns a "duplicate class declaration" error from the lignes in blue when i try to compile my code.   :-\
See the code below.
It seems that the problem is from the fact that the constructors and functions declared has the same name  :o
Any suggestions ?


//-----------------------------------------------------------------
// Include Files
//-----------------------------------------------------------------
#include "windows.inc"

//-----------------------------------------------------------------
// Custom Data Types
//-----------------------------------------------------------------
struct BITMAPINFO_256
{
  BITMAPINFOHEADER  bmiHeader;
  RGBQUAD           bmiColors[256];
};

//-----------------------------------------------------------------
// Bitmap Class
//-----------------------------------------------------------------
class Bitmap
{
protected:
  // Member Variables
  HBITMAP m_hBitmap;
  int     m_iWidth, m_iHeight;

  // Helper Methods
  declare Free();

public:
  // Constructor(s)/Destructor 
  declare Bitmap();
  declare Bitmap(HDC hDC, LPTSTR szFileName);
  declare Bitmap(HDC hDC, UINT uiResID, HINSTANCE hInstance);
  declare Bitmap(HDC hDC, int iWidth, int iHeight, COLORREF crColor = RGB(0, 0, 0));
  declare _Bitmap();

  // General Methods 
  declare Create(HDC hDC, LPTSTR szFileName),BOOL ;
  declare Create(HDC hDC, UINT uiResID, HINSTANCE hInstance),BOOL ;
  declare Create(HDC hDC, int iWidth, int iHeight, COLORREF crColor),BOOL ;
  declare Draw(HDC hDC, int x, int y);
  declare GetWidth(),int { return m_iWidth; };
  declare GetHeight(),int { return m_iHeight; };
};
Title: Re: problems with class
Post by: John Syl. on July 03, 2007, 07:04:40 AM
Function overloading is not supported in Aurora!

regards
John
Title: Re: problems with class
Post by: pistol350 on July 03, 2007, 07:49:11 AM
Thank you John!
"Function overloading" is the correct term that i needed. ;D
Anyway, i assume that by just renaming the functions as (myfunction1(), myfunction2(), ... ) i can get them work properly.

Thanks!
I am going to try this!
Cheers!
Title: Re: problems with class
Post by: John Syl. on July 03, 2007, 10:11:15 AM
Yea took me a while to remember the correct term as well ;D

Renaming as you suggest will be fine.

regards
John