🔒 Locked
DDraw device enumerating problem
Advertisement
Original Post
Hi all!.
ok , here is my question:
im trying to define my function to enumerate for directdraw devices , its looks like that:
bool WINAPI DDEnumCallbackEx(GUID FAR *lpGUID,
LPSTR lpDriverDescraption,
LPSTR lpDriverName,
LPVOID lpContext,
HMONITOR hm);
and im calling to this function with this code:
HRESULT CEnumerate::EnumerateDevices(DD_DEVICE_INFO *DDDeviceInfo)
{
HRESULT hRet;
hRet = DirectDrawEnumerateEx(DDEnumCallbackEx,NULL,
DDENUM_ATTACHEDSECONDARYDEVICES //
DDENUM_DETACHEDSECONDARYDEVICES //
DDENUM_NONDISPLAYDEVICES);
return hRet;
}
when i trying to compile my project i get this error:
"c:\vsdxwlib\cenum.cpp(32) : error C2664: ''DirectDrawEnumerateExA'' : cannot convert parameter 1 from ''bool (struct _GUID *,char *,char *,void *,struct HMONITOR__ *)'' to ''int (__stdcall *)(struct _GUID *,char *,char *,void *,struct HMONITOR__ *)''
None of the functions with this name in scope match the target type"
somebody know why?
thanks a lot
Posted By Xeno.
Kobe Bryant - "Just believe in yourself"
Visit my web site : VSoft
Just change the ''bool'' to ''BOOL''.
(A bool is 8-bits big in VC, and BOOL is 32-bits, so a BOOL is the same as an int, where a bool isn''t)
(A bool is 8-bits big in VC, and BOOL is 32-bits, so a BOOL is the same as an int, where a bool isn''t)
i did it.... no, still got the error. 
i think its something with that: "(__stdcall *)" , its the only part that not the same between the two functions that displayed in the error massege,
somebody know what its mean?
Posted By Xeno.
Kobe Bryant - "Just believe in yourself"
Visit my web site : VSoft
Edited by - Xeno on June 26, 2000 4:08:24 PM
i think its something with that: "(__stdcall *)" , its the only part that not the same between the two functions that displayed in the error massege,
somebody know what its mean?
Posted By Xeno.
Kobe Bryant - "Just believe in yourself"
Visit my web site : VSoft
Edited by - Xeno on June 26, 2000 4:08:24 PM
A shot into the dark here....
I too got this error, when I was using classes to encapsulate the DDraw enumeration. However from what I see, the compiler doesn''t like the declaration.:
I too got this error, when I was using classes to encapsulate the DDraw enumeration. However from what I see, the compiler doesn''t like the declaration.:
BOOL WINAPI DDEnumCallbackEx(GUID FAR *lpGUID,
LPSTR lpDriverDescraption,
LPSTR lpDriverName,
LPVOID lpContext,
HMONITOR hm);
[\code]
WINAPI should expand to __stdcall, it does with my borland compiler. Try changing the WINAPI to __stdcall.
[code]
BOOL __stdcall DDEnumCallbackEx(GUID FAR *lpGUID,
LPSTR lpDriverDescraption,
LPSTR lpDriverName,
LPVOID lpContext,
HMONITOR hm);
[\code]
Maybe it''s just a quirk of the MS compiler?
C++Freak.
*&@#%^
How the hell do you get that nice white code textbox? Sorry about the formating of the above post..
C++freal
How the hell do you get that nice white code textbox? Sorry about the formating of the above post..
C++freal
why do u think that i thinking u mental or anything ?? 
u just tried to help and for some reason (that really crack me off :p) for u its worked and for me not.

well, at least it working now , when i declare on the function as a static function.
Posted By Xeno.
Kobe Bryant - "Just believe in yourself"
Visit my web site : VSoft
u just tried to help and for some reason (that really crack me off :p) for u its worked and for me not.
well, at least it working now , when i declare on the function as a static function.
Posted By Xeno.
Kobe Bryant - "Just believe in yourself"
Visit my web site : VSoft
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement