Can anybody tell me how to sort a map based on the values.
Why do you want to do that? Your desire suggests that you have misunderstood the purpose of a map. The key is supposed to be unique and the value is identified by its corresponding key so you may write code such as in order to retrieve the "box" associated with the key:
Box& box = Map[key];
However, if your "boxes" are unique you may use them as keys, e.g.:
hello guys... I have a listbox on my dialog. I am debugging my program and getting this error. Here is what I am trying
if(ListBox.GetCount() >= 1)
//then do some stuff
Now when I select ListCtrl.GetCount() and select Add Watch, it shows me the said error. Now although the problem is solved using following technique but what if I don't want to add unnecessary variables.
int count = ListBox.GetCount();
if(count >= 1)
//then do some stuff
This world is going to explode due to international politics, SOON.
Probably the fastest would be a shared memory pool... but are you sure you need that speed? A lot of times, people think they need the best of something when they really only need something that is good enough.
For example, even though shared memory would probably be the fastest option, it would probably not be easy to implement across multiple systems, your server and client would always have to be on the same machine (and by default, same OS), whereas if you used something more versatile like sockets, you could have your system work across different machines (or in the same one, no difference), different operating systems, different states, and even different countries.
So, make sure that you really need all that speed. For example, a phone conversation can be transmitted over sockets with no issue, but digitized IF (if you know what that means) could only go up to certain rates efficiently over a network.
What exactly does this imply for a Native Code programmer?
Nothing really... it's not like the WinAPI is going away.
Will a traditional MFC application just work in Windows 8?
They should, accessing desktop applications is not going away. There was an article about this not too long ago stating the intent for Visual Studio to keep supporting desktop application development, which means it will keep getting supported in Windows.
Sure, no problem. I've kept an eye out for this as well since I work on desktop applications. I doubt they'll completely get rid of the traditional desktop support any time soon, if so, I'm sure Linux will have a ton of users flocking in their direction. The market for traditional desktop applications is still large for the engineering/scientific community.
You need to send the handle of the dialog to the thread because all thes window funcs come in two forms:
::SetDlgItemText(HWND, IDC_Blue, Blue);
And the Class Specific:
myDlgItem->SetDlgItemText(IDC_Blue, Blue); or this->SetDlgItemText(IDC_Blue, Blue);
'this' is of course given for free if you are inside the actually controls class so you can write:
So, you are in a thread, NOT in the MFC class instance, so you need to pass the window handle to the thread in order to manipulate it there.
Or even better create your own messaging system so you can send a message to the main window thread from your thread so the main window thread can do all the detailed work rathert than having to code it in your worker thread.
I don't think you can cast the LHS of an expression. It should be:
SockCLeintThread* current = dynamic_cast<SockCLeintThread*>(AfxGetThread());
AfxGetThread() returns a CWinThread* by default, so you need to cast that to the actual type that will be returned when storing it in your thread pointer. If you define current as a CWinThread* then you will not be able to use it as a SockCLeintThread* anywhere following.
Hi I have downloaded aarot.zip and trying to understand the code. Bcoz i need to implement that on embedded programming. But the API used here is not known to me. So can anyone help me to understand the code.
AND IF POSSIBLE Plz help me to know source code of the functions SetDIBits and GetDIBits. How it is working.
I write a program about authentication fingerprint. For example, cursor is on notepad window or on textbox of any program, If the authentication process is right, I want to display "Yes" characters to position where cursor is blinking. If display at textbox of this program, this process is easy. However, I want to display at textbox of other program as skype program, google chrome program or notepad program.
You wanna modify your title of this thread because your other thread has the EXACT same title, do it before the moderators or admin takes some hard action against you.
But anyways, a Google(R) search here may give the answer, I mean hey Google may suck from time to time, but why not give it a try? your be surprised what you may find, try looking on the other pages except the first page of results.
Simple Thanks and Regards, Brandon T. H.
Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst).
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
I need ftp C/C++ functions/classes to process ftp uploading/downloading tasks.
When I used software [FileZilla FTP Client], it sends/obtains many interesting events/messages, such as:
Status: Resolving address of www.xyz.com
Status: Connecting to 11.222.333.444:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 3 of 1000 allowed.
Response: 220-Local time is now 15:16. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER xyz
Response: 331 User xyz OK. Password required
Command: PASS *****************
Response: 230 OK. Current restricted directory is /
Response: 215 UNIX Type: L8
Response: 211-Extensions supported:
Response: REST STREAM
Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
Response: AUTH TLS
Response: 211 End.
Status: Retrieving directory listing...
Response: 257"/"is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Response: 227 Entering Passive Mode (74,220,215,241,4,101)
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 22633 matches total
Status: Directory listing successful
(many more ...)
Those events are very useful and in details, I think MFC FTP classes are NOT powerful enough to process them.
What FTP C/C++ functions/classes are used by [FileZilla FTP Client] (or better than them)? I'd like to try them.
In MFC, you should not directly access UI elements from background threads.
Instead, you must send messages to the UI thread to get and set elements for the UI.
Use can use SendMessage or PostMessage.
Not entirely true. The reason for not accessing UI elements from another thread than the main thread is that you can quite easily create a deadlock situation. MFC classes for UI elements uses ::SendMessage() which will block until the message has been handled. If the main thread is not processing messages, possibly waiting for the thread that manipulates the UI element, the application will deadlock. This of course means that you cannot use ::SendMessage(), even if you call it directly, as it would create the same potential deadlock situation.
::PostMessage() must be used since it doesn't wait for the message to be handled. It is possible to use ::SendMessageTimeout() to avoid a deadlock situation, but if the call fails the receiving thread never gets the message.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
Last Visit: 31-Dec-99 19:00 Last Update: 22-Jan-17 8:13