enumdevicescallback part of class?
thanks a bunch for the replies!
now i want to make the EnumDevices callback part of the class, but when i do that it says "can't convert an overloaded function to (_stdcall)(bla bla)". i'm not very good with classes, but first of all, i didn't overload it and secondly, i just don't see why it won't work:
now i want to make the EnumDevices callback part of the class, but when i do that it says "can't convert an overloaded function to (_stdcall)(bla bla)". i'm not very good with classes, but first of all, i didn't overload it and secondly, i just don't see why it won't work:
HRESULT CALLBACK SD3d::EnumDevicesCallback(LPSTR lpDescription,LPSTR lpName,LPD3DDEVICEDESC7 lpd3ddd,LPVOID lparg)
{
//code here
return D3DENUMRET_OK;
}
bool SD3d::Setup(LPDIRECTDRAW7 lpdd,LPDIRECT3D7 lpd3d,HWND hWnd3d)
{
if (FAILED(lpd3d->EnumDevices((LPD3DENUMDEVICESCALLBACK7)this->EnumDevicesCallback,NULL)))
{
return false;
}
return true;
}
Thanks!
Alex.
Umm... very cool!
I would use it except I'm pretty sure that its non-portable and compiler-specific, since Microsoft wrote the CRT and the compiler.
Hell, you could put a main() function in there as well because in Windows main() is also not the real entry point.
But still, very cool. If you think that the WinMain belongs in a class, then it can and should be done!
- Splat
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement