Sign in to follow this  

help debugging please

This topic is 4865 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

LPDIRECTDRAW g_pDD;
LPDIRECTDRAWSURFACE g_pDDSBack;
LPDIRECT3DRM g_pD3Drm;
LPDIRECT3DRMDEVICE3 g_pD3DrmDev;
.....
.....
hr = g_pD3Drm->CreateDeviceFromSurface(NULL, g_pDD, g_pDDSBack, &g_pD3DrmDev);
.....
.....
.....

i get an error : basis3.cpp:56: error: no matching function for call to `IDirect3DRM::CreateDeviceFromSurface(NULL, IDirectDraw*&, IDirectDrawSurface*&, IDirect3DRMDevice3**)' C:/DEV-CPP/include/d3drm.h:70: error: candidates are: virtual long int IDirect3DRM::CreateDeviceFromSurface(_GUID*, IDirectDraw*, IDirectDrawSurface*, IDirect3DRMDevice**)

Share this post


Link to post
Share on other sites
You either forgot to implement (write the code for) that function or you have mismatching parameters. i.e. you're passing IDirectDrawSurface*& when the function requires IDirectDrawSurface*.

If you've implemented the function and it just doesn't like the DirectDraw LP parameters being passed in, try 1 of 2 things. Try declaring and implementing the function so that you pass the address to LPDIRECTDRAW pointer, instead of the LPDIRECTDRAW pointer itself. Then inside the function, just dereference the double pointer. The other thing you could try is to declare:

IDirectDraw *g_pDD;
IDirectDrawSurface *g_pDDSBack;

I would try this approach first. I don't know for sure why your code doesn't work with those parameters, because LPDIRECTDRAW is just defined as such:
typedef struct IDirectDraw FAR *LPDIRECTDRAW

Good luck,
Chris

Share this post


Link to post
Share on other sites
Read the error message carefully. The problem is this: the last parameter of should be an address of a pointer to IDirect3DRMDevice. You passed the address of a pointer to IDirect3DRMDevice3.

I don't know how to fix it, but one of these three should be the right thing to do:

1. Change LPDIRECT3DRMDEVICE3 to LPDIRECT3DRMDEVICE.
2. Change CreateDeviceFromSurface to CreateDeviceFromSurfaceN where N is the latest version.
3. Include the proper header files.

Share this post


Link to post
Share on other sites

This topic is 4865 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this