I have come across a new way to loop through collections and range.
It consist of example code below:
for (auto const &x : vec)
// x is a reference to an const item of vec
// We can not change vec's items by changing x
This is definitely new to me and a welcome change as using auto creates a placeholder for any types and can be anything with a proper cast to return back to its original form.
The new loop also simplifies the code as more explain by the link:
Ctrl+Shift+ B | Build the project
Ctrl + – | Ctrl + Shift + – | Navigate backwards and forward
Ctrl+K then Ctrl+C | Comment selected or cursor
Ctrl+K then Ctrl+U | Uncomment selected or on the cursor
Ctrl+K then Ctrl+F | Format and beautify selected code
Ctrl+L | Delete a line or selected
Ctrl+U | Changes the selected text to lowercase characters
Ctrl+Shift+U | Changes the selected text to uppercase characters
Ctrl + W | Selects the word near the cursor or highlighted one
Ctrl+Tab | Change active document among the open ones.
Ctrl+Shift + Space | Show tool tip for parameter function.
Ever wonder how put a separate folder into the task bar?
Found a topic online with easy step to follow.
Credit to the author.
Been developing a lot in .NET and C/C++ and been overwhelm by the fact that character encoding plays a part in building applications. One might not know that it existed under the hood but understanding why they are there is crucial to getting different quirks and bugs.
In laymen term each machine or computers have a standard default character encoding that translates each character to a byte and multi-byte (Unicode). Mostly nowadays Unicode is used to support wide variety of characters from native English alphabet to other non-english like Chinese, Japanese etc.
Check the link below for a very thorough explanation and more about character and coding and types in Windows system.
Including _T(TCHAR) macro that tells the compiler to use char or wchar_t and L”Literal” to interpret the string as a unicode multibyte string.
Copied and Pasted from the article:
## symbol is token pasting operator, which would turn
L"Unicode", where the string passed is argument to macro – If
_UNICODE is defined. If
_UNICODE is not defined,
_T("Unicode") would simply mean
"Unicode". The token pasting operator did exist even in C language, and is not specific about VC++ or character encoding.
Note that these macros can be used for strings as well as characters.
_T('R') would turn into
L'R' or simple
'R' – former is Unicode character, latter is ANSI character.
No, you cannot use these macros to convert variables (string or character) into Unicode/non-Unicode text
Been a while since I posted here because I been trying to complete this simple File Renamer using .NET technology.
Its almost completed you can now view the project source code through this link: https://github.com/chopnut/ErnanisRenamer
I see myself always trying to open a command prompt in my network drive and I always get an error, to remap the drive again as administrator access level is different to a normal access, you have to re-map the network drive again to work.
Here is the syntax to actually do just that:
net use Z: \\NetworkDrive\FolderName
I know I should not link a already well made documentation but for my sake and my project. I d like to put in on here anyways.
Since I have been dealing with different data types in C, its hard to remember what they do and what they stands for. Eg. LPCWSTR, LPBYTE etc.
Here is the link to the documentation: C Common Data Types
Also another I want to touch on is Windows C/C++ Calling Convention in what it actually means in laymen term. Here is an article about it:
Basically compiler has a way to call a function and how to clean up after the call is made. How arguments are push into the stack and who is responsible for cleaning up after. __stdcall usually makes the caller responsible for pushing the argument from LEFT->RIGHT and make the CALLEE responsible for clean up. __cdecl is from RIGHT->LEFT and makes the caller responsible for cleaning up.
Ive just found a way to execute a program within your program.
and how to read registry using C++
I know its pretty slow trying to put them all together but I have not stopped yet just been really busy.
What Exactly Are ATL’s BEGIN_COM_MAP, END_COM_MAP, and COM_INTERFACE_ENTRY Macros?
By the way this post is for my self reference only. I often forget things like this. To get an idea why we need to declare our class with reference to the interface we are trying to implement.
There is no interface in c++, but can be created using virtual functions thus making it an abstract class.
An abstract class or interface cannot be instantiated only declare as a pointer or a reference to a derived class.
See this post in stack overflow for understanding interface.