|
If your on Eclipse it is a known bug (id=173732)
The fflush(stdout); fix is the only way around it as horrible as it is.
In vino veritas
|
|
|
|
|
Windows 7 UAC prevents my application to write log data in the installation folder. The original text log file exists from the very beggining, but its empty.
When I start my app with the -L parameter to start logging, it does not write anything due the UAC control. If I rum my app with Admin Priviledges then it works.
As you can understand I can not suggest my client to run the app with right click and "run as an Administrator".
Is there any solution for that ?
Best Regards,
sdancer75
|
|
|
|
|
Yes - don't try to write files in the installation folder. Your application will not have permission to do so.
Instead, create a folder for your application under one of the AppData locations - CSIDL_APPDATA, CSIDL_LOCAL_APPDATA or CSIDL_COMMON_APPDATA - and write the log files to that folder.
CSIDL (Windows)[^]
SHGetFolderPath function (Windows)[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you
Is that backward compatible with windows xp/vista ?
I think that win Xp does not support AppData. Is that correct ? What to do in this case ? Check the os and take a path decision specifically for it ?
sdancer75
|
|
|
|
|
It should be supported in XP - the folder was called "Application Data" / "Local Data" back then.
They changed it to "AppData\Roaming" and "AppData\Local" in Vista to reduce the chances of code breaking the 260-character path limit. Similarly, the "Documents and Settings" folder was renamed to "Users".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you for your help
Best Regards,
sdancer75
|
|
|
|
|
This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes.
The message type is always 874(x36A).
The only true call backs I have are for custom draw list boxes and typically when I have an error in those routines MFC catches and breaks at that point. Obviously that are countless other messages processed.
I am trying to determine A: what is message 874? and B: what circumstances cause it to be posted (though A may answer B)?
|
|
|
|
|
I cannot find the specific message number in Winuser.h in VS 2013, but I did find the following two lines:
#define WM_AFXFIRST 0x0360
#define WM_AFXLAST 0x037F
Googling for WM_AFXFIRST came up with: WM_AFXFIRST - Google Search[^].
|
|
|
|
|
Thanks - I found those two - Jochen below narrowed it down.
|
|
|
|
|
Message 0x036A is WM_KICKIDLE (defined in afxpriv.h). It is a private MFC message used to update the UI (e.g. menu items, tool bar buttons and the status bar).
So you might check your UI update handlers if one of those is the error source.
|
|
|
|
|
Thanks - I must have been too tired to figure that one out.
|
|
|
|
|
Austin Donaghy wrote: This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes.
There is a good essay of Joe Newcomer: Debug vs. Release[^]
I'd recommend to check it out!
|
|
|
|
|
99% of the time if you get a difference between release and debug mode you forgot to zero a variable and assume it is.
Turn the warning levels up to full and you should get a warning saying "use of uninitialized variable".
Usually it is something like this
int Bad (int someval){
int i;
if (someval > 0){
i = 1;
}
if (i == 0) return (1);
return (0);
}
In debug mode all local variables are zeroed automatically. That simply doesn't happen in release mode the variables will start at whatever rubbish was in the stack at the position it was allocated.
In the above code the behaviour of "bad" is totally predictable in debug mode as "i" will always start at 0. In release mode you have no idea what is going to happen as "i" could start at any value and the return is purely chance based.
Look carefully at the code, now try compiling it and tell me if you get a warning
In vino veritas
modified 8-May-16 9:48am.
|
|
|
|
|
hi i m quite newbie at computer programming and i need more detailed information about classes at c++.is there any good detailed book about classes at c++
modified 6-May-16 7:17am.
|
|
|
|
|
|
|
I have a question about the Computational Geometry, C++ and Wykobi which is found at the link below.
Computational Geometry, C++ and Wykobi[^]
The code available with this article has a VCL graphics file named 'wykobi_graphics_vcl.hpp' for use with the IDE C++Builder from Embarcadero Technology. Are there any instructions to compile these files into a C++Builder project? Some of the files are the VC file type .inl which I am not sure how to handle.
Thanks.
|
|
|
|
|
Please use the forum at the end of the article, so the writer of the article (and code) can help.
|
|
|
|
|
How do I implement Windows Compatibility Mode in Win8, to install a Program that works Successfully in Win XP Basic Version.
In case you think I'm in the wrong forum, think again. There are people here in this world who do this. These People are programmers, who run on a shoe string, and, cannot afford the exorbitant prices charged by Microsoft for the next compiler version, (they are amateurs, doing a bit of a hobby, but, also people to keep the next generation interested in Core Languages and Principles, such as 'C', 'CPP', etc.)
I am talking about trying to install VC3, MFC42, and the DevStudio97 to run in compatible mode in Windows 7, 8, or 10.
I do not think that me using state of the art compiler and development software from the 19990's to teach children about programming in MFC is going to make a big dent into the profits of Microsoft.
But, it will give a number of 'Street Children' a real experience and hopefully an interest in computing.
My Credo is: The Closest you can come to inciting a Magic Incantation, is, by writing the Code about which you want to happen! Before you can do so, you need the 'Book of Spells', I.E. the MFC Documentation, The Background, the How It Works, Etc.
After All, Programming Has to do with knowledge of the Spell Book.
Regards,
Bram van Kampen
|
|
|
|
|
First I am not sure why you are complaining about cost from Microsoft, Visual Studio will cost you exactly $0 as an amateur for the express version. The cost is exactly 1 valid email login address to be exact and a bit of spam they will send to that address. So perhaps get off the bash Microsoft band wagon because in this regard your attack is completely off base and not justified. The cost of Microsoft compilers for amateurs/students has been $0 for about 5 years including there new compiler.
Visual Studio Express[^]
Quote => Visual Studio Community has all the features of Express and more, and is still free for individual developers, open source projects, academic research, education, and small professional teams.
In other words if you aren't in a large company you don't pay a cent ... still want to moan and complain?
What is missing in express is the ability to share code live with a group (Team Project), some restricted MSDN libraries and access to the commercial MSDN forum area, which will mean about zip to you as an individual.
Now to your actual answer, Visual Studio uses a manifest if you want to do that which it binds into the EXE file stub. I don't know the specifics of how it does it would be in the PE stub at the front of every windows EXE file.
If you want to do it off 3rd party tools you would need to see if tools exist to do such a thing. The alternative is to download Visual Studio for free and compile your code that way.
Finally however any user can do it by simply right hand clicking on the desktop icon and setting the compatibility mode and saving it which requires ZERO coding.
In vino veritas
|
|
|
|
|
Hi,
Does it support MFC ?,
I am not really interested in C#, etc. MFC is my 'Comfort Zone'.
Thanks for informing me about these (to me) new MS Policies,
Going to have a Down Load!
Stop Press Stop Press!
Doing the download. Looks Good! Supports MFC! Great! Last time I looked, all free environments where only for C#, etc. MFC was always at a considerable premium. As a small time developer, I could never justify several thousand dollars for a Compiler, and I Struggled on with VS98, and MFC42. However, it always did the Job. Hope it has a Debugger, which does Machine Code and assembler. Thanks also to the local community centre, which asked me to provide this course! It caused me to ask the Question. My Idea is to take the Mystique away, Show What Code does, and, that a Compiler is really only a Translator, between A Language (such as CPP), A Library of Code written by Others, (i.e. The Standard 'C' Libraries, and, say MFC), Machine Code (The Language of the CPU, which is where I started more than 40 years ago, Assembler, (The Human Readadable (and sometimes Writable) Code)(Just another Language)!
Thanks, and Thanks again Regards,
Bram van Kampen
modified 5-May-16 19:29pm.
|
|
|
|
|
Yes there was a Quantum shift in tools from MS from 2012 with concerns about rise of linux and android and developers moving to them based on cost of tools. VS 2015 is the first of the multiplatform tools they are saying they will release it can compile for android and various phone variants.
There is a new product they seem to be playing with called Visual Studio Code. It is actually something strange from MS its OpenSource, you can download the code for the editor and compiler and second it has releases on Linux, Windows and Mac. It is also weirdly multilingual it compiles Java, C#, C++, PHP, and HTML. I don't like the thing but there is a community growing around it because it is OpenSource.
In vino veritas
|
|
|
|
|
Well, Thanks Leon.
I've been struggling on with Vs98. Downloaded a few 30 day appraisals of VS round 2007, MFC at the time was never included as part, it focussed at the time on the likes of 'CE' and 'C#' Was Decidedly not interested in that, because to learn it would most certainly take more than 30 days, given the free time I had at the time to apply myself. On further learning, about CE and C#, I did not want to use it for my programs. Also, had to buy within 30 days.
The Recent'Free' for people like Mijself, I Never was aware of. Evidently not widely published. I'm a Retired Engineer, and a One Man Software Development Company. The Latter mainly as a Hobby. We (with my partner Deirdre) also run a successful Laundrette,(that is the business that pays the bills, and more) and I have written the Software to run the same. The software covers several applications (Sales Counter, ShopFloor, BackOffice), running on multiple terminals. It keeps track of Sales, Cash, Stock, Staff Performance, and many more things. In other words, it does our thing.
Now, my Win8 Computer got in terrible confusement! Since last month it can no longer accept Windows update.
It also cannot accept the VisualStudio Down Load, it spent the last 24 hours to establish a Reference Point.
I'll get that seen too within the next few days.
The surprise will be how the Old Project Files will be Accepted by the New Software. May need to write some conversions there
Regards
Bram van Kampen
|
|
|
|
|
VS2103 does a fair job of the conversions, we can help with any that it misses. VS2015 is better by far at the conversion.
Realistically you will probably get more trouble initially from deprecated (unsafe) calls that it will complain about, things like strcat, strcpy etc. You either have to set the compiler or pragma comment to stop them or actually use the new safe versions so strcpy_s, strcat_s etc. They carry extra parameters which is the size of all buffers exchanged by these unsafe calls. It usually takes 10-15min to convert them all in a decent length project.
It's not hugely complicated but can be annoying when you first open a project.
In vino veritas
|
|
|
|
|
I'd advise against trying it - I spent a while trying to install Visual C++ 2003 on a Windows 7 machine after ignoring the warnings that it wasn't supported and suffered a quite nasty crash during the installation. You might have more success with an earlier version but personally I wouldn't want to risk it.
Have you considered installing it in a Windows XP virtual machine instead?
|
|
|
|
|