Now. I am getting focus on first button of toolbar. I clicked SPACEBAR and this button get pressed. It open a dialog , after my operation I closed it.
After that, Unfortunately second button get activated. I pressed spacebar again.It will pressed that button and called related function , which will open another dialog. After my operation, I closed it .
Now the focus went to First button. According to project requirement the focus must retain to the last clicked button. I checked in project code, nowhere first button getting activated explicitly.
I am working on a legacy Windows app written in Win32.
There's a checkbox in the screen and i call the SetFocus() function to have the focus on it. I know that it works as far as setting the focus, because now i can use space button in keyboard to check and uncheck the checkbox.
But the problem is, when a control get's the focus, it's supposed show a broken rectangle around it. In my case this broken rectangle is not drawn/shown all the time. Sometimes it shows the broken rectangle and some times it doesn't.
I need to show some visual indication to user that this checkbox has the focus. I tried using WM_CTLCOLORSTATIC, but that creates some painting issues in the window.
So am looking for a simpler solution, by which i could show some visual indicator to user that this checkbox is having focus.
Like changing the text color or background color or even force draw a broken rectangle.
But i have no idea how to do this without using the WM_CTLCOLORSTATIC.
Is there a easier way to show some sort of visual indication on a checkbox in Win32?
There's a bunch of good texts listed in this[^] thread.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
My app was running fine with Windows 7 & 8.1 using URLDownloadTofile(NULL,sUrl,SFile,0,NULL). With the upgrade to Windows 10 it has stopped working. I've made sure my app has security settings to allow it through the firewall (and this hasn't changed) but now the request to download fails. Also the Visual Studio 2008 Document explorer now just comes up with "Unable to download " which makes me suspect it's a more general problem that just my app. I can't find any security settings that should be blocking my app.
If any one could shed some light on my problem I'd be grateful. I've trawled around the web for a day with no useful results.
Thanks it turned out the problem was that the directory that the Temporary Internet files were stored in no longer existed after the update to Windows 10. Trying to change this under the Control Panel application for Internet settings failed to change the directory as the one that it was trying to move the files from did not exist. The only way to correct the problem was to manually edit the registry key as explained here:
Oh I doubt it. I dont think anyone's ever used c++ to read xml files, let alone written a library for it. Google will surely vindicate me..
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
I am rewriting an old application in VS2010 that was developed in vc++6.0. I am trying to keep the basic structure of the GUI the same which consists of a main Dialog in which I have multiple child dialogs. All the child dialogs except one are simple with no border, title bar or system menu. This works fine in VC++6.0, but on VS2010, none of the controls that I have in those child dialogs show up when I run the program.
Am I missing something simple here that I am not aware of?
Its a MFC dialog based application. Main dialog is created when the application is created using "New Project" wizard and the child dialog is created by inserting a "Insert Dialog" in resource view and then adding dialog controls to it.
I really do not know where to post this and I hope I can explain my question , so be gentle.
I am using SAM3x8e hardware timer (TC3) as an interrupt. The “TC3_Handler” (callback?) global function name is “hardcoded” somewhere and fires as expected at desired intervals. I do some verification of this by outputting simple message to LCD. The LCD “class” is declared / instantiated as a global class to the entire application and works amicably. Simple “lcd.print(“OK”)” is executed just fine in the TC3 handler. I also do some hardware output – turn on / off LED – just for an additional indication the handler is being executed.
Now I want to execute a method / function of ANOTHER globally defined / instantiated class, again in same TC3 handler.
Adding cpal.Run(); did not compile – undefined “cpal”.
I had to ADD extern CPAL cpal; so it would compile and execute cpal.Run();
My question is both LCD and CPAL classes are global, the LCD can be used OK, but the CPAL has to have the extern “reference” added into the TC3 handler. Why?
Thanks for reading, appreciate any help. Cheers Vaclav
Thanks, makes perfect sense. I am not sure I'll spent time to actually look for such declaration, but I need to learn more about hardware interrupts so maybe I'll run into it sooner or later. Thanks again. Vaclav
You know, it's one thing to obfuscate, it's another to code in such a style as approaching enemy action. It's hard enough to write clear code. The style of code I posted just seems easy to break and difficult to debug. The debugger is going to treat that like one line of code.
Caveat: I freely admit that I choose to restrict how much code I put on a line. I like using ternary or conditional operator as it can make things much cleaner, as long as you don't get silly with it.
Charlie Gilley Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
This is not too complex, but at the limit where I would consider breaking it up into multiple statements.
That said, if that were a while condition, I might be more inclined to leave it like that, because (a) the increment might be considered part of the loop iteration, and (b) moving part of the condition might require more than one additional line (e. g. once before the start of the loop and once inside).
Apart from that, I am more bothered with the naming
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)