msvcrt

Are Visual C++ dynamic runtime libraries part of the Windows OS nowadays?

让人想犯罪 __ 提交于 2019-12-04 17:41:55
问题 Are the dynamic runtime libraries for Visual C++ (more specifically 2008) part of the Windows OS nowadays? I noticed that at least on Windows 8 you no longer need to ship these with your application or have the user install the redistributable package from Microsoft. Is this true? If so, for what Windows versions and for what versions of Visual C++ does this apply to? 回答1: No, they've never been part of the Windows distribution. Deploying them yourself is a hard requirement. It certainly may

CRT initialization and DLLMain

自作多情 提交于 2019-12-04 12:57:51
Quotes: From the document "Best Practices for Creating DLLs" http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/DLL_bestprac.doc of Microsoft: "DLLs often have complex interdependencies that implicitly define the order in which they must be loaded. The library loader efficiently analyzes these dependencies, calculates the correct load order, and loads the DLLs in that order." [1] "(within DLLMain) Use the memory management function from the dynamic C Run- Time (CRT). If the CRT DLL is not initialized, calls to these functions can cause the process to crash." [2]

Right arrow symbol causing abrupt end of fread?

为君一笑 提交于 2019-12-04 12:21:46
I am attempting to write a bittorrent client. In order to parse the file etc. I need to read a torrent file into memory. I have noticed that fread is not reading the entire file into my buffer. After further investigation it appears that whenever the symbol shown below is encountered in the file, fread stops reading the file. Calling the feof function on the FILE* pointer returns 16 indicating that the end of file has been reached. This occurs no matter where the symbol is placed. Can somebody explain why this happens and any solutions that may work. The symbol is highlighted below: Here is

How to detect key press when the console window has lost focus

删除回忆录丶 提交于 2019-12-04 12:01:11
My application sends a mouse click to an area of the screen outside my console window using win32api.mouse_event . This causes my window to lose focus so I can't detect key presses using msvcrt.kbhit. My question is, how to implement something like this with the console window not being visible/active? EDIT: Here is example code. This is just a basic console version. If the console disappears, set it so that it stays on top. Once it clicks outside of the console (100,100), pressing the Esc key will not break out of loop. How would one implement a break for a problem such as this? import msvcrt

Cant Run Application Created With QT5 And VS2013 In Windows XP

只谈情不闲聊 提交于 2019-12-04 10:51:52
I have application created with QT5 and Visual Studio 2013 . I also use QT WebEngine in my application. My application works fine in windows 7 (32 bit) . For some reason i need to run it in windows xp sp3 (32 bit). When i run it, I get the following error: The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll I press OK several time and it goes away and my QMainWindow will pop out, But its totally BLACK and i see the following errors in debugger. class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum

Statically linking against library built with different version of C Runtime Library, ok or bad?

≯℡__Kan透↙ 提交于 2019-12-04 02:58:01
Consider this scenario: An application links to 3rd party library A. A is built using MSVC 2008 and is statically linking (ie. built with /MT) to the C Runtime Library v9.0. The application is built using MSVC 2005 and is statically linking to A and (using /MT) to the C Runtime Library v8.0. I can see trouble with this - for instance if types are changed in the headers between runtime library versions. Is care taken to keep the runtime library headers compatible between versions, or should one always make sure all statically linked libraries are linking to the same version of the runtime

PyCharm: msvcrt.kbhit() and msvcrt.getch() not working?

亡梦爱人 提交于 2019-12-04 02:50:37
问题 I've tried to read one char from the console in PyCharm (without pressing enter), but to no avail. The functions msvcrt.getch() stops the code, but does not react to key presses (even enter), and msvcrt.kbhit() always returns 0. For example this code prints nothing: import msvcrt while 1: if msvcrt.kbhit(): print 'reading' print 'done' I am using Windows 7, PyCharm 3.4 (the same heppens in idle). What is wrong? Is there any other way to just read input without enter? 回答1: It's possible in a

Simple Assembly program on visual studio 2017

心不动则不痛 提交于 2019-12-03 16:31:15
.386 .model flat, c .stack 100h printf PROTO arg1:Ptr Byte .data msg1 byte "Hello World!", 0Ah, 0 .code main proc INVOKE printf, ADDR msg1 ret main endp end main Hi, I am getting the below errors: I searched around and found someone said that it can be fixed by linking the microsoft runtime library Can anyone teach me how can I exactly fix it? Thanks Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol _printf referenced in function _main testing C:\Users\Kin\Desktop\assembly\testing\testing\Source.obj 1 Error LNK1120 1 unresolved externals

In which cases is the dynamic CRT not already initialized on call to user supplied DllMain?

会有一股神秘感。 提交于 2019-12-03 15:59:55
Preamble: This question is specifically concerned with, and only with, the behavior of the dynamic CRT used through /MD . It does not question the validity of any other recommendations wrt. DllMain . As we've been told : (ref: Dynamic-Link Library Best Practices, MSDN, May 17, 2006) You should never perform the following tasks from within DllMain: ... Use the memory management function from the dynamic C Run-Time (CRT). If the CRT DLL is not initialized, calls to these functions can cause the process to crash. ... Others have questioned this already (as in: questioned the validity of the

Are Visual C++ dynamic runtime libraries part of the Windows OS nowadays?

最后都变了- 提交于 2019-12-03 12:12:30
Are the dynamic runtime libraries for Visual C++ (more specifically 2008) part of the Windows OS nowadays? I noticed that at least on Windows 8 you no longer need to ship these with your application or have the user install the redistributable package from Microsoft. Is this true? If so, for what Windows versions and for what versions of Visual C++ does this apply to? No, they've never been part of the Windows distribution. Deploying them yourself is a hard requirement. It certainly may seem that they are. Starting with msvcrt.dll in the system32 directory, it has the same name as the C++