msvcrt

Using msvcrt.getch() in Eclipse / PyDev

≡放荡痞女 提交于 2019-11-27 06:52:22
问题 I wanted to use msvcrt.getch() in Eclipse with PyDev to read a signe char but I found out that it just don't work (but It works in the Windows console). Any idea what to do ? 回答1: Maybe use sys.stdin.read when run in PyDev? like sys.stdin.read(1) read 1 line from input...For use in Windows console and in PyDev make same selection based on os and run variants(using sys.stdin.isatty ). For example next code read timelimited user input. But when run in Windows console if program's standard input

What is the cause of “This application has requested the Runtime to terminate it in an unusual way”?

安稳与你 提交于 2019-11-27 06:35:46
There's a common error that gets thrown by the Visual C Runtime: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. What does this error message actually mean ? Let me use a parable to explain exactly what i'm asking. If I see a message: Exception: access violation (0xc0000005), Address 0x702be865 This access violation has nothing to do with sexual harassment, or someone trying to break into my computer (any more than General Failure was a brigadier general who was trying to read my C drive, or that

Windows malloc replacement (e.g., tcmalloc) and dynamic crt linking

时光怂恿深爱的人放手 提交于 2019-11-27 05:19:47
问题 A C++ program that uses several DLLs and QT should be equipped with a malloc replacement (like tcmalloc) for performance problems that can be verified to be caused by Windows malloc. With linux, there is no problem, but with windows, there are several approaches, and I find none of them appealing: 1. Put new malloc in lib and make sure to link it first (Other SO-question) This has the disadvantage, that for example strdup will still use the old malloc and a free may crash the program. 2.

How to make vcredist_x86 reinstall only if not yet installed?

点点圈 提交于 2019-11-27 00:03:10
In my inno setup RUN selection I force silent install of MSVCRT. I wonder how to make it install itself only if not yet installed? This is what I call now: Filename: {tmp}\vcredist_x86.exe; Parameters: "/passive /Q:a /c:""msiexec /qb /i vcredist.msi"" "; StatusMsg: Installing 2010 RunTime... TLama Since you don't want to tell what minimal version of Visual C++ redistributable package you require, here you have the code sample from which you can build this by your own. Please notice that I have no clue, what versions are compatible with what and what lower versions must be installed, I'll keep

How to have password echoed as asterisks

孤街醉人 提交于 2019-11-26 19:08:33
I am trying to figure out how to prompt for a password, and have the users input echoed back as asterisks ( ******** ) So recently, I took on the project of creating a remote server that could be connected to using the socket module in Python. It's not yet done, as I am in the process of making the console used to connect to the server. I am trying make a login window where a user is prompted to enter their Username and Password, although when the password is entered I am looking for asterisks to be printed, like common password entry (i.e. - Sekr3t is echo'd as: * * * * * *). After days of

How do I get the file HANDLE from the fopen FILE structure?

房东的猫 提交于 2019-11-26 16:49:08
问题 The fopen function returns a pointer to a FILE structure, which should be considered an opaque value, without dealing with its content or meaning. On Windows, the C runtime is a wrapper of the Windows API, and the fopen function relies on the CreateFile function. The CreateFile function returns a HANDLE , which is used by other Windows API. Now, I need to use Windows API deep inside of a library that uses fopen and FILE* . So: is there a way to get the HANDLE from the FILE structure? As this

Visual C++ executable and missing MSVCR100d.dll

懵懂的女人 提交于 2019-11-26 15:58:18
问题 I know this has been asked in other places and answered, but I'm having issues with MS Visual Studio 2010. I've developed a C++ executable but if I run the Release version on a machine that doesn't have the VC++ runtime library (ie, msvcr100d.dll), I get the "program cannot start because msvcr100d.dll is missing from your computer" error. This is weird for two reasons: Why is it trying to link with the debug version of the redistributable? I tried applying this fix, setting the runtime

How to Enforce C++ compiler to use specific CRT version?

一曲冷凌霜 提交于 2019-11-26 14:29:24
问题 I am using VS2008 for developing a COM dll which by default uses CRT version 9 but I am using TSF (Text service framework) that is not compatible with the new CRT. I think the solution is to use the compatible one so how can I specify the CRT version? 回答1: I whole heartily join the recommendation not to manually change the CRT version you link against. If however, for some reason (which I cannot imagine) this is the right course of action for you, the way to do so is change the manifest for

Should I compile with /MD or /MT?

浪尽此生 提交于 2019-11-26 14:03:41
In Visual Studio, there's the compile flags /MD and /MT which let you choose which kind of C runtime library you want. I understand the difference in implementation, but I'm still not sure which one to use. What are the pros/cons? One advantage to /MD that I've heard, is that this allows someone to update the runtime, (like maybe patch a security problem) and my app will benefit from this update. Although to me, this almost seems like a non-feature: I don't want people changing my runtime without allowing me to test against the new version! Some things I am curious about: How would this affect

What is the cause of “This application has requested the Runtime to terminate it in an unusual way”?

会有一股神秘感。 提交于 2019-11-26 10:27:40
问题 There\'s a common error that gets thrown by the Visual C Runtime: This application has requested the Runtime to terminate it in an unusual way. Please contact the application\'s support team for more information. What does this error message actually mean ? Let me use a parable to explain exactly what i\'m asking. If I see a message: Exception: access violation (0xc0000005), Address 0x702be865 This access violation has nothing to do with sexual harassment, or someone trying to break into my