You can do it for the entire system, but I don't know of any way to do it for
just one app
The single MFC Feature Pack application is ignoring my system settings so I thought there might be a way to force it to behave and pay attention to the system settings but so far, I've dug around in the BCGSoft/Microsoft source code for CMFCVisualManager and the label/caption drawing code simply uses the DC passed in so I guess I need to see where that DC comes from and see if it can be modified.
I'll dig around the BCGSoft site. I have to say, by the time I figure out how to use this Feature Pack stuff, they'll have moved on to something new again.
For a socket client in Windows you basically need to call the following functions in order - WSAStartup[^] - Initialize winsock. socket[^] - Create the socket specifying the required protocol like TCP, UDP etc. connect[^] - Connect the previously created socket to the specified server.
After this step the connection is ready.
To communicate with the server you can use the following functions - send[^]/sendto[^] - Send a stream of bytes to the server. recv[^]/recvfrom[^] - Receive a stream of bytes from the server.
To tear down the connection the following functions must be called - closesocket[^] - Disconnect WSACleanup[^] - Cleanup winsock.
«_Superman_» I love work. It gives me something to do between weekends.
Thanks for the reponses.. guess i'm not clear with my question..
I'm clear about the WinSocket APIs.. just need to know the WebSocket Handshake details..
I got the below header from Wikipedia & i want to know what are all the things are variable values in this header?
Also it seems that once the client receives "HTTP/1.1 101 WebSocket Protocol Handshake" it should just wait on recv or recvfrom. Am I correct ? If so, who closes the socket connection once all communication is done? The server or the client ?
I'm trying to work through the example code in the MSDN DirectSound Programming Guide to enumerate sound devices.
When I run my app, the ComboBox which should list the available sound devices is for some reason empty.
Below is the Callback Procedure I've used for the Direct Sound device enumeration.
FYI Inspecting lpGUID during debugging reveals that the first time the if(lpGUID != NULL) is reached, it's value is 0 so the statement evaluates to FALSE, and lpszDescription points to the 'P' of "Primary Sound Driver". The call to ComboBox_AddString processes ok without returning CB_ERR or CB_ERRSPACE. The process repeats for the other available devices, but once it's finished the ComboBox remains empty!?
Below is my Callback procedure for the dialog containing the ComboBox. I've added a static text to display the total number of entries as a check, but this shows "Num Entries: 0" when I run the app. What am I missing here?
I added the break; after the case WM_INITDIALOG: block. Thank you, this was an oversight. Unfortunately it has not fixed the problem.
I've now added a static int called iCount to the callback procedure where I call ComboBox_AddString(). I've used ComboBox_GetCount() to update iCount.
I've also added some error handling to the ComboBox_AddString() call.
When I put in a breakpoint here and debug, I see that iCount remains at 0 each time the code passes through.
Below is my revised code.
Is it something to do with the way I'm trying to pass the ComboBox handle to the DSEnumProc procedure when I initialize the dialog? I notice that the value of hCombo in the code below is different from the value in the code above when I debug.
I think I understand what you mean though. lpContext is a pointer which contains the address of hCombo when I pass it, so I need to dereference lpContext when I'm initializing the local hCombo in the callback, right?
I've tried HWND hCombo = (HWND)*lpContext; but the IDE says "Error: expression must be a pointer to a complete object type". Is it incorrect to declare, dereference, cast and initialize all in the one statement?
Actually, it would be simpler to just keep your callback code the same, and write (Void*)hCombo. A HWND will fit into a pointer-size variable, which is what lpContext is. So keep the callback like you had it before: HWND hCombo = (HWND)lpContext;
Address of the DSEnumCallback function that will be called for each device installed in the system. lpContext
Address of the user-defined context passed to the enumeration callback function every time that function is called.
So I assumed lpContext had to be a pointer, but since it's just being passed straight on to the callback function anyway, I guess it doesn't have to be.
Your help is greatly appreciated.
Last Visit: 31-Dec-99 19:00 Last Update: 31-Jan-23 4:18