Mail Archives: djgpp/1998/03/21/09:45:17
Hi,
I have some source from http://www.relisoft.com/ (great place for Win32), but I can't compile them under RSXNTDJ. Probably problem is in templates :
Functions are defined like this :
template <class T>
inline T GetWinLong (HWND hwnd, int which = GWL_USERDATA)
{
return reinterpret_cast<T> (GetWindowLong (hwnd, which));
}
template <class T>
inline void SetWinLong (HWND hwnd, T value, int which = GWL_USERDATA)
{
SetWindowLong (hwnd, which, reinterpret_cast<long> (value));
}
and later used :
.....(code fragment)
// Pointer to Controller is stored in Window
Controller * pCtrl = GetWinLong<Controller *> (hwnd); // line a
switch (message)
{
case WM_CREATE:
try
{
pCtrl = new Controller (hwnd, (CREATESTRUCT *) lParam);
// Store pointer to Controller inside Window
SetWinLong<Controller *> (hwnd, pCtrl); // line b
}
during compile I.ve got a messages (for line a, b and other) :
parse error before '*'
Is it standard template construction or VC++ specific?
Thanks.
Ps. Sorry for my English.
- Raw text -