You want to use a c++ WebSockets library that will work correctly (particularly) during the handshake operation. The implementations you have tried so far fail during the handshake operation because the required Key is not exchanged correctly. The application used to test for successful connection will be Google Chrome.
I.e - you wish to use a C++ WebSockets library that is compatible with (if not the very same) as the one used by the current version of Google Chrome.. Sorta thought that must have been what you meant.
Well, I'd start looking through these links myself. I'd also be keen to consider modifying a non-working library such that the handshake operation mirrored that exhibited by the C# code you already have (but prefer not to use)
Of course, time is a luxury often not afforded in large measure when undertaking paid projects. I understand this and realize my responses may be little more than noise. :shrugs:
I'd also be keen to consider modifying a non-working library such that the handshake operation mirrored that exhibited by the C# code you already have (but prefer not to use)
Thank you for the idea about modifying the existing library based on code from another language that works. I was able to get the libwebsockets working in C++ now so I no longer need to use managed C++ or C# for the project. I found that there were a few problems, one being that the SHA1 and Base64 encoding schemes were not functioning correctly for some reason. Once I fixed those, and re-ordered the way the packets is sent, the library works wonderfully. So, thanks for the idea. The links really helped to understand how I needed to modify the existing code to get it working.
Nothing is impossible, It's merely a matter of finding an answer to the question of HOW? ... And answering that question is usually the most difficult part of the job!!!
It's a pleasure. I thought my idea would prove unpopular, though have read RFCs and modified code to conform in the past. The value of what I learned far exceeds the value of the time taken to do it, sure beats simply downloading a working implementation.
On a side note - nice sig! I've said for a long time "Everything's easy.... You just have to know how. Building a nuclear bomb is easy - _if_ you know how"
I have a dialog that contains some radio buttons and a list box I wondered how can I pass a message to another object that the user chaghed his selection by press one of the redio buttons, I need to call to a method of the second object accordeing the user selction .
It depends how the objects are subclassed (or derived) and who their parent is. Just about all buttons in MFC are CWnd derived, but their event handlers are usually managed by the parent window (usually some CDialog or some sort of form).
If the second object that you're referring to is another button type of object, that is owned by the same parent window, then it's ok to make direct calls to access the other object. On the other hand, if that other object is in a separate dialog or form, then you should pass a message using SendMessage or PostMessage to the parent window and let it handle the event.
It's going to make quite a big difference as to what these "objects" you are talking about are and who the owner is. A number of different solutions will probably work, but you should be careful and follow framework guidelines as you may end up with an unstable solution.
Its a simple process with a number of small steps.
1. Wire-up the message handling of the radio buttons so that you get a WM_NOTIFY (or whatever the pertinent message is) whenever the active radio-button in the group changes.
2. Call method of object 2 with the selected option passed in as a variable somehow - either as text, or (preferably) as an INT that represents the choice number.
Here's a dialog-based app that demonstrates the principle. Whether you call the method of the second object when the selection changes or when an 'action' button is pressed, is up to you.
(And yes, I do realize that as they're radio-buttons, one of the options should be checked by default - just can't remember how just this minute - it was easier and quicker to add a test case to check if an option had been selected yet or not )
That's okay. In fact - I didn't make any call to the method of object 2. Please accept my apology for being unclear.
As I alluded to earlier, I can see two places where such a call would make sense.
In the first case, there would be action immediately after a radio button was pressed.
I imagine you would not have the same need to keep track of the currently selected option, so I've omitted that code from the following case statements.
Example 1: Immediate response
In this second example, you'll need to remember which radio-button is selected somewhere, before taking the appropriate action when the trigger is received (in this case, the pressing of the button labelled Test) Example 2: Action taken in response to another input
if (curRadioOption == -1)
MessageBox(hwndDlg, "Select a radio button first!", "Error", MB_ICONERROR);
Something else I should mention, is that MFC will most likely allow the state of any control to be quickly and easily queried (not sure if there's an object used to represent a group of radio buttons - I'd imagine that there was) This will make my global variable curRadioOption redundant.
...if i go from one dialog to another , how can i close it and save its contents
The dialog is closed by clicking the Cancel button, the X, Esc, Alt+F4, or by calling EndDialog(). Where are you wanting to save its data to? Some internal data structure, or some external storage like a file?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
I did not put any cancel or close,it is without title bar.I make sdi application with
full screen and in menu of upper level i put the chose where you can open the new
dialog.I am calling dialog boxes from the Viewclass.but didnot find how to close or switch to other dialog when user click the other options of open other dialogs
Do yo have any coding to calling mulitple dialogboxes in SDI applicaiton
is there any c++ tutorial or (simple) open source sample how to write an OLE object that can be embedded into MS Office applications such as powerpoint?
Just like, for example, an Origin Graph or a corel draw image which are directly embedded into a powerpoint presentation.
When I search for OLE, I most often only find how to automate Office...