Archived

This topic is now archived and is closed to further replies.

DDraw Modes Enumeration problem

This topic is 6362 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! , im trying to enumerate the supported modes on some ddraw device , im define my enumerate function in a class , like that:
                    
class CEnumerate {
private:
       static BOOL WINAPI DDEnumDevices(GUID FAR *lpGUID,
                                LPSTR lpDriverDescraption,
			        LPSTR lpDriverName,
			        LPVOID lpContext,
			        HMONITOR hm);

       HRESULT WINAPI DDEnumModes(LPDDSURFACEDESC lpDDSurfaceDesc,
                           LPVOID  lpContext); // in this defintion the problem


public:
       HRESULT EnumerateDevices(DD_DEVICE_INFO *DDDeviceInfo);
};



and i call to the "DDEnumModes" function with this command:

DDrawObj->EnumDisplayModes(0,NULL,(LPVOID) info,DDEnumModes);


now, when i trying to compile it , i get this error:

"C:\VSDXWLib\CEnum.cpp(53) : error C2664: 'EnumDisplayModes' : cannot convert parameter 4 from 'long (__stdcall CEnumerate::*)(struct _DDSURFACEDESC *,void *)' to 'long (__stdcall *)(struct _DDSURFACEDESC2 *,void *)'
        There is no context in which this conversion is possible"


            
somebody know's why? Edited by - Xeno on 7/13/00 3:11:17 PM Edited by - Xeno on 7/13/00 3:12:44 PM Edited by - Xeno on 7/13/00 3:13:37 PM Edited by - Xeno on 7/13/00 3:14:02 PM

Share this post


Link to post
Share on other sites
Try this declaration:


static HRESULT WINAPI DDEnumModes(LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext);


...Syzygy

Edited by - syzygy on July 13, 2000 12:15:09 AM

Share this post


Link to post
Share on other sites
Your DDEnumModes function needs to be static and you may have to cast away the namespace when you pass it into the function: e.g.

(LPDDENUMMODESCALLBACK2)DDEnumModes

Jans.

-----------------
Janucybermetalrvgothmogbunny

Share this post


Link to post
Share on other sites