|
littleGreenDude wrote: called me a liar
That's not true, just because I cited other people I worked with having far less than you claim to have doesn't mean I think you are lying. I work with people now that have 2/3 the time in the industry as you with degrees that couldn't program their way out of a wet paper bag. It's not really possible to conclude anything about a developers expertise only from the credentials you listed off.
littleGreenDude wrote: you've insulted my career choice
That one I'm not following
littleGreenDude wrote: and accused me of whining
I'll stick by that one
For the record I don't have a clue what your expertise as a developer is. Your posts so far have not really provided information that could be used to gauge that. Due to that, many of my observations about developers were intentionally not aimed at you in any way. My last reply is just explaining, why, from your posted qualifications my inclination is to believe you would be perfectly capable of refactoring to tab controls in several days.
I did understand you were working with legacy code that you may not have written. None of that however changes my opinion about what a minimum quality solution to the problem might be, which is what I gave you.
My normal posting style tends to be sarcastic. That coupled with my disdain and normally direct refusal to hack software solutions has falsely given you the impression that I have been attacking you. I apologize for that but my stand on your development problem has not changed.
led mike
|
|
|
|
|
hi there,
Could anybody please help me in this:
I need to check the current time in my application after each message that my application receives and whenever it is midnight I reset a counter inside my program.
I appreciate any ideas
Thanks,
Nahitan
|
|
|
|
|
In your window's message procedure, do something like:
time_t t;
time(&t);
tm *now;
now = localtime(&t);
if (now->tm_hour ...)
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you very much for your help. When I added your code in my application and when I compile it I get:
time_t mt; time(&mt); tm *now; now = localtime(&mt);
LogError("ClassA","IClass","jjjjjjjhour=%tm", now->tm_hour);
Error executing c:\windows\system32\cmd.exe.
Class.dll - 1 error(s), 0 warning(s)
Thanks,
|
|
|
|
|
So which of the three staments is in error?
What does %tm do?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You confused the poor compiler somewhere. Set a few breakpoints, and find out what's happening.
Work with Asserted Values, Run Trivial Examples, Write a Dedicated App to take just this step (Can be a Dialog based App,Call your code in OnInitApp() ). This is called 'Debugging'. The above are the steps I would take, and in that following order. I bet that Step One will lead you to the solution.
It may be slow and tedious, but that's what writing software is about.
Let me know how you're getting on.
Bram van Kampen
|
|
|
|
|
I can't figure out what to do. I changed the code to:
time_t mt; time(&mt);
tm *now;
now = localtime(&mt);
if (now->tm_hour==16){LogError("AClass","BProcess","Hour is 4 pm");}
I still get the same error message
Without these 5 lines of code, I do not get any error. I even took out the if statement and I still get the error!
|
|
|
|
|
time_t mt;
time(&mt);
// I would use mt =time(NULL);
struct tm *now;
now = localtime(&mt);
tm is part of the tag Name Space. Not part of cpp as such, but still there
// Works in MSVS 5.00
Bram van Kampen
|
|
|
|
|
Thanks a lot, worked perfectly!
Thanks thanks thanks,
|
|
|
|
|
Thinking a bit further.
struct tm is part of the C-Runtime, not CPP. That's why you need to qualify tm as a structure tag. In other words, struct tm was declared as a structure tag under 'C' it has therefore no typedef value under cpp.
Regards
Bram van Kampen
|
|
|
|
|
<br />
#include < windows.h ><br />
#include < stdio.h ><br />
<br />
void main(){<br />
<br />
SYSTEMTIME sysTime;<br />
GetLocalTime(&sysTime);<br />
printf("\nHour = %d",sysTime.wHour);<br />
<br />
}<br />
modified 20-Oct-19 21:02pm.
|
|
|
|
|
Hi,
How does the listbox part of combobox appear beyond the parent's client area without being clipped whereas a hand made listbox,when moved near the edge of the parent's client area get clipped?
I mean, suppose the parent's client area is 300x300. If I move a combobox to 100,250 with dropdown height as 100 and click on it, it opens up. Now suppose I move a listbox of size 100x200 to 100,250. It is clipped.
What's the trick ? I guessed the combo's listbox is sibling of the combo's parent and has higher Z order....
I need this to work. F1.
Koder.
|
|
|
|
|
I would guess the combo box's list window is a child of the desktop window.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I would guess the combo box's list window is a child of the desktop window.
Well you can't actually get Spy++ on the drop down window ( at least I can't figure out how ) but putting on one that has the list displayed statically or on a rolled-up combobox does not show the desktop as an owner of the any of combobox windows.
led mike
|
|
|
|
|
I wouldn't expect or assume anything on a rolled-up combobox but what do you mean by
"the list displayed statically"?
Heck, now that I think about it more, it doesn't need to be a separate window...
The control code can just draw it on the screen (to a screen DC)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Heck, now that I think about it more, it doesn't need to be a separate window...
The control code can just draw it on the screen (to a screen DC)
Yeah that's what I was thinking, it's a common control so who knows what it's doing.
Mark Salsbery wrote: but what do you mean by
"the list displayed statically"?
Well you can see one in the Notepad Font Dialog or do one in your own MFC dialog by setting the "Type" property to "Simple"
led mike
|
|
|
|
|
led mike wrote: or do one in your own MFC dialog by setting the "Type" property to "Simple"
That doesn't draw outside the parent for me (on Vista/Common Controls V6).
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: That doesn't draw outside the parent for me
Did you lengthen it vertically in the designer after setting the property? And put data in it?
(XP Pro VS2005 ) What is the DLL so I can check the version?
Wow, what an idiot, "outside the parent", I was thinking the edit box part of the control not the parent window of the combobox.
Guess I picked a bad day to stop smoking crack. Have a great weekend Mark, i'm outa here! Last modified: 18mins after originally posted --
led mike
|
|
|
|
|
led mike wrote: Did you lengthen it vertically in the designer after setting the property? And put data in it?
Yes. And put it at the bottom of the dialog. If I resize the dialog by dragging the bottom edge down,
the items come into view.
led mike wrote: (XP Pro VS2005 ) What is the DLL so I can check the version?
Beats me - which dll has the combobox implementation?
I just meant I was using the <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0'...
manifest entry
Is this the daily "how does it work" session? hehe If more people would do that, there wouldn't be many posts here LOL
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hehe just saw your modified post.
led mike wrote: Have a great weekend Mark, i'm outa here!
Thanks, man, you too!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
From MSDN:
"Due to its size, the list box component of a drop-down combo box may need to extend beyond the client area of the combo box's parent window. Windows creates the list box as a child of the desktop window"
|
|
|
|
|
son of a gun!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
So, Desktop it is..will try.
Thanks.
|
|
|
|
|
That must be it...most of them said that.
Thanks. Will try.
|
|
|
|
|
Assuming MFC...
Attempt #1: You can CreateEx() with WS_POPUP style but that will deactivate your app while the popup is up and your popup window will show up in the taskbar.
Attempt #2: You can give it an extended style of WS_EX_TOOLWINDOW to prevent the taskbar entry but that doesn't solve the deactivated application problem.
The solution is to avoid WS_POPUP and use CreateEx() with an extended style of WS_EX_TOOLWINDOW, style of WS_CHILD, and make the parent the desktop window.
There are other issues to contend with but that will get you a window that can extend beyond the window of your application.
Hope that helps.
|
|
|
|