Advertisement

can't create and use ddraw in same function?

Started by November 13, 1999 03:18 AM
1 comment, last by AlexM 25 years, 3 months ago
I'm not 100% sure about this but it may be as simple as chaging to to:

(*lpdd)->

Just because the church was wrong doesn't mean Galileo wasn't a heretic.It just means he was a heretic who was right.
i'm trying to create ddraw and use it in a function call, passing it the address of lpdd:

int SetupDDraw(LPDIRECTDRAW7 *lpdd,HWND hwnd)
{
DirectDrawCreateEx(NULL, (VOID**)lpdd, IID_IDirectDraw7, NULL);
*lpdd->SetCooperativeLevel(hwnd,DDSCL_FULLSCREEN |
DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT);
return 1;
}
the creation works fine, but i get "need class on the left of SetCoop...", well lpdd is the address of the pointer, so *lpdd is the pointer.. why doesn't this work?

Thanks in advance!
Alex

Advertisement
What I'd suggest doing is this. Change your function to use LPDIRECTDRAW7 &lpDD instead of *lpDD. Then just use the creation methods exactly as you would if lpDD was just a global.

DirectDrawCreateEx(NULL, &lpDD,...);
lpDD->SetCooperativeLevel(...);

It should work fine then

Jonathan

[This message has been edited by Jonathan (edited November 13, 1999).]

This topic is closed to new replies.

Advertisement