How do I programmatically get the version of a DLL or EXE file?

You would use the GetFileVersionInfo API. See Using Version Information on the MSDN site. Sample: DWORD verHandle = 0; UINT size = 0; LPBYTE lpBuffer = NULL; DWORD verSize = GetFileVersionInfoSize( szVersionFile, &verHandle); if (verSize != NULL) { LPSTR verData = new char[verSize]; if (GetFileVersionInfo( szVersionFile, verHandle, verSize, verData)) { if (VerQueryValue(verData,”\\”,(VOID FAR* FAR*)&lpBuffer,&size)) { … Read more

Why is the compiler throwing this warning: “missing initializer”? Isn’t the structure initialized?

GCC is just being overly paranoid – for no good reason in my opinion, but then it’s certainly true that the GCC maintainers know a lot more about the nuances of C that I do. See this small thread of discussion about the problem on the GCC mailing list: missing initializer warnings 1998-07-01. 1/3. missing … Read more

What’s “wrong” with C++ wchar_t and wstrings? What are some alternatives to wide characters?

What is wchar_t? wchar_t is defined such that any locale’s char encoding can be converted to a wchar_t representation where every wchar_t represents exactly one codepoint: Type wchar_t is a distinct type whose values can represent distinct codes for all members of the largest extended character set specified among the supported locales (22.3.1).                                                                                — C++ … Read more

How to list physical disks?

#WMIC wmic is a very complete tool wmic diskdrive list provide a (too much) detailed list, for instance for less info wmic diskdrive list brief #C Sebastian Godelet mentions in the comments: In C: system(“wmic diskdrive list”); As commented, you can also call the WinAPI, but… as shown in “How to obtain data from WMI … Read more

Can multithreading be implemented on a single processor system?

I recenetly read it somewhere that I can do multithreading on single processor system as well. Is it correct? and if yes then what is the difference between single processor and multiple processor systems? Yes you can do multithreading on a single processor system. In multi-processor system , multiple threads execute , simultaneously on different … Read more

Manipulate system/visible clipping region in Windows 1809

If we take ReactOS as an example, the clipping region is at dc->dclevel.prgnClip and the system region is at dc->prgnVis. When you call BeginPaint on a window, it calls NtUserBeginPaint stub which traps to its kernel counterpart through the win32k SSDT, which calls IntBeginPaint, which passes the window’s update region (Window->hrgnUpdate) to UserGetDCEx, which copies … Read more

What’s the differences between VirtualAlloc and HeapAlloc?

Each API is for different uses. Each one also requires that you use the correct deallocation/freeing function when you’re done with the memory. VirtualAlloc A low-level, Windows API that provides lots of options, but is mainly useful for people in fairly specific situations. Can only allocate memory in (edit: not 4KB) larger chunks. There are … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)