M
Marcel Müller
When compiling the following code I get the error below.
It seems that the call to WinQueryAccelTable is entirely ignored.
Is the code or the compiler wrong? (gcc.exe (GCC) 3.3.5 (Bird Build
2007-06-10 14:30))
----------
typedef void* HAB;
typedef unsigned long HWND;
typedef unsigned short HACCEL;
HACCEL WinQueryAccelTable(HAB hab, HWND hframe);
class MenuShowAccel
{public:
// Create worker class from accelerator table.
MenuShowAccel(HACCEL accel);
void ApplyTo(HWND menu, bool incl_sub = true);
};
HAB hab;
HWND hframe;
HWND hmenu;
void foo()
{ MenuShowAccel(WinQueryAccelTable(hab, hframe)).ApplyTo(hmenu);
}
----------
----------
D:\TEMP>gcc test.cpp
test.cpp: In function `void foo()':
test.cpp:19: error: no matching function for call to `MenuShowAccel::
MenuShowAccel(void*&, HWND&)'
test.cpp:8: error: candidates are: MenuShowAccel::MenuShowAccel(const
MenuShowAccel&)
test.cpp:10: error: MenuShowAccel::MenuShowAccel(short
unsigned int)
test.cpp:19: error: parse error before `.' token
----------
It seems that the call to WinQueryAccelTable is entirely ignored.
Is the code or the compiler wrong? (gcc.exe (GCC) 3.3.5 (Bird Build
2007-06-10 14:30))
----------
typedef void* HAB;
typedef unsigned long HWND;
typedef unsigned short HACCEL;
HACCEL WinQueryAccelTable(HAB hab, HWND hframe);
class MenuShowAccel
{public:
// Create worker class from accelerator table.
MenuShowAccel(HACCEL accel);
void ApplyTo(HWND menu, bool incl_sub = true);
};
HAB hab;
HWND hframe;
HWND hmenu;
void foo()
{ MenuShowAccel(WinQueryAccelTable(hab, hframe)).ApplyTo(hmenu);
}
----------
----------
D:\TEMP>gcc test.cpp
test.cpp: In function `void foo()':
test.cpp:19: error: no matching function for call to `MenuShowAccel::
MenuShowAccel(void*&, HWND&)'
test.cpp:8: error: candidates are: MenuShowAccel::MenuShowAccel(const
MenuShowAccel&)
test.cpp:10: error: MenuShowAccel::MenuShowAccel(short
unsigned int)
test.cpp:19: error: parse error before `.' token
----------