🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Async Windows Message

Started by
2 comments, last by Gaiiden 23 years, 7 months ago
Yo. I''m having trouble defining my Windows message when i declare my socket as an Async socket. I get the impression you can call it whatever you want right? Like WM_ASYNC or WM_WSAASYNC or whetever. However, I get an error saying my message declaration (in the function) is an undefined constant and in the callback function case statement I get an error saying the case expression is not constant. What''s goin on here?? ============================== "Need more eeenput..." - #5, "Short Circuit" ==============================

Drew Sikora
Executive Producer
GameDev.net

Advertisement
You need to assign a numerical value to your windows message.
So if you use WM_ASYNC you should have somewhere:
#define WM_ASYNC (WM_USER + 5)
(or some other value instead of 5) or use a const statement.
const int WM_ASYNC = WM_USER + 2;
I thought the socket sent your winproc those msg''s when it recieved a packet (ie you shouldn''t be sending them)
Just talking out my arse though...
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Magmai Kai Holmlor: The third argument to the WSAAsyncSelect() call is the window message that will posted by winsock when an network event occurs. You need to know it''s numerical value both for the call to WSAAsyncSelect() and in order to register your message handler within the message pump.

This topic is closed to new replies.

Advertisement