|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
This message has been flagged as potential spam and is awaiting moderation
|
|
|
|
|
Non-modal ActiveX Control, a self-draw CMyTreeCtrl is shown on it.
Now, I create a CMFCToolTipCtrl in my CMyTreeCtrl and I want to dynamically change the text color of Tooltip.
I use SetParams in the ToolTip callback function and set new color/text .
However, I can't get new color when the tooltip displayed.
After I debug and found that it can't enter CMFCToolTipCtrl onPaint. If I use invalidate, then the whole ActiveX Control will flash rapidly.
I inherited CMFCToolTipCtrl and found that WM_PAINT cannot be received in PreTranslateMessage.
It can only receive WM_TIMER. Any other functions in afxtooltipctrl.h are not entered when the tooltip is shown.
And CMyTreeCtrl can receive WM_PAINT.
Could you help me find the reasion? Thanks a lot.
|
|
|
|
|
I have an old MFC Dialog Based app that was designed in the WinXP and Win7 era. This project is for internal use and no longer in development. In Win10, we have scaling issues with high DPI screens (some controls are small or positions compressed), which is to be expected. However, on standard DPI screens, there have not been any issues until now.
One user reports that the dialog window is correctly sized (fixed sized), but all the controls within the window are scaled up beyond the boundaries of the dialog window and so half the controls are hidden. Display scaling settings in windows is normal (100%). What could be causing this?
|
|
|
|
|
How hard could it be for Visual Studio (new or recent or even old versions for that matter) to convert this old MFC Dialog-based application?
If it could convert this old MFC Dialog-based application it will. If it can't then attempting to open it's project files will result in a telling error message which, of course, will be useful to the learned helpers here on CP.
Try posting that message.
|
|
|
|
|
Can you clarify convert to what?
I can open the project in Visual Studio 2019 without issues after installing the older toolsets. I do need to maintain compatibility with WinXP. There are some computers that are still running WinXP due to old software/hardware compatibility.
I'm not sure if the UI issue is related to MFC. Converting to .NET forms would not be a simple task.
|
|
|
|
|
If you have a business process that is still running on Windows XP, you have MUCH BIGGER problems than this MFC code.
The hardware does not last forever, and when (not if!) it fails, then what? What are you going to replace a bad motherboard with? Or this "old hardware"? What happens when that fails? Hardware that old isn't made any more and good luck trying to find someone to fix it.
Modern day machines will not run Windows XP. Hell, nowadays, Windows 10, or a modern equivalent is required!
Your process is teetering on the brink of failure.
|
|
|
|
|
So if you're talking about WinXP 32-bit (there was actually a time when one who licensed this had an opportunity to acquire the 64-bit installation disks believe it or not) or if you were indeed one of those paying attention to the offer to get that 64-bit version and had machines that could run 64-bit OS and successfully got it up and running (just before Windows Vista 32 & 64 bit made it evident that the future was going to be 64-bit and hyperthreaded as well) you are probably also aware that once Windows 2000 was supersceded, no 16-bit programs were allowed to run anymore.
And since you suggest VS2019 will open this application and you're not telling me about the previously mentioned flags during conversion I'd say you're good to go to set the project build targets to whatever is available and test a compilation.
Next moves:
1. Move some controls around and recompile.
2. Re-reference "missing" assemblies (or COM objects/whatever) and if not able to do that try what you suggest, substitute .NET interops (sometimes that works).
3. Sift through the compile/link errors (I'm finding it hard to believe that you've opened this thing without any conversio notices actually) ... use VERBOSE; note what crops up as documented error or warning.
And finally, since this is clearly a hardware issue for you (which I also doubt has anything to do with MFC of any flavor of MS Windows), try hooking up a less resolute monitor.
Graphics card you ask. Also doubtful. MFC is MFC is MFC (it's VS that fronts the eminence)
|
|
|
|
|
Have you tried running the app in compatibility mode?
|
|
|
|
|
Are the controls being created at runtime?
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
No, that's not how this site works. We'll help you with YOUR code, but the site is not a "code to order" site.
|
|
|
|
|
I have used this free tool on Windows 7 for years, https://www.codeproject.com/Articles/354/A-Utility-to-Clean-Up-Compiler-Temp-Files , it's useful.
I now want to use this utility to clean up compiler temp files on Windows 10, but after registered the DirClean.dll file, the two menu items do not show on the context menu. I check the source files, but I can't find what is wrong.
Thank you for help!
|
|
|
|
|
Please use the forum at the end of the article so the person who wrote the article can help you.
|
|
|
|
|
There is few reply in the article forum, so I start this thread here. Thanks!
|
|
|
|
|
If you knew the extensions that you wanted to routinely delete (e.g., obj, tmp, pdb), you could simply add them to a BAT file something like:
del /s *.obj
del /s *.tmp
...
Put the BAT file in the parent folder of your work area and run it when needed. You could even create a scheduled task to do it automatically.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
i wanna ask, can anyone suggest any good tutorials references for learning C from the beginning, especially for the latest C version (C17, afaik) ?
refs can be web, e-books, or anything
note:
i tried google. found no tutorials for this.
|
|
|
|
|
C is a rather stable language, every standard doesn't add so many features like happens, for instance, with C++ , so you may find (of the tons available) a good tutorial on a previous version (e.g. C99 or C11 ) and start learning. Then, in order to complete your knowledge, you may access the freely available 'final draft of the standard' (external link in the very wikipedia page: C17 (C standard revision) - Wikipedia[^].
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
but there's errors in old syntax if we use old tutorials
coz, there's tutorials using old syntax of C and that's not used in today's C's syntax anymore
e.g.: i have K&R book and their example is like:
#include <stdio.h>
main () {
}
that's why i'm looking more for tutor that suit with the latest C's syntax, which is C17
|
|
|
|
|
I didn't say it has not changed. It changed, but just a little. You haven't to go back to K&R. While probably there aren't yet many tutorials on the latest standard, there are many many available good ones for recent versions of it. That could be your fishing pond.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
ok, i guess i'll go for tutorials around 2015 and above
do you have any suggestions on this?
|
|
|
|
|
|
i searched more for C17 and not just C tutorials
coz, there's tutorials using old syntax of C and that's not used in today's C's syntax anymore
e.g.: i have K&R book and their example is like:
#include <stdio.h>
main () {
}
i'm looking more for tutor that suit with the latest C's syntax, which is C17
|
|
|
|
|