C: Common Data Types and Calling Convention __stdcall

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.

Extern “C” and Name Mangling

Name mangling is very common in C++ compilers when a function have the same name with different parameters or overloading.

As the compiler compiles your code, with a function with the same name , the compiler tries to rename the function or method so they dont clash with each other at runtime and providing different signature.

Using Extern “C” on the other hand if you are calling a C function exactly as it is from your C++ code. With a syntax of

extern “C” statement or block of code

This prevent the compiler from mangling the name at compile time otherwise getting bunch of errors and crashes.

Here are some good articles about it:

Here some good link about Calling Convention: eg. __stdcall, __cdecl

C & C++: Shell Extension Need to know and understand

Its been a while since I posted something here due to my lost of my  laptop. Anyways aside from that I’m now back and continue this journey of the shell extension in c and c++.

I have asked about the the fundamental of the COM in stack overflow. Follow this question on there to get more information.


Follow the link for a beginner explanation as well for terms and classes, typedef, and windows.h

This is also for reference for myself.

More to come in my shell extension journey.

C++: Road Block – Renamer Tool

I was just coding away with my Renamer Tool and suddenly hit a road block. My Renamer tool is a Csharp WPF application that renames files according to Filter set by the user. It will also features a way to select multiple files from window explorer to be selected and right clicked to open up with the program.

I thought this was simple as I was googling along adding context menu feature. It led me to..

Shell Extensions.

Ugh… it is said that writing a shell extension in managed code like CSharp is discouraged. And mostly the only way is through..

C++ Active Template Library or COM…. went to have a look through how to implement this. Questions upon questions upon questions!

Apparently writing a shell extension in C++ is like diving to a different world of programming, prepare to go back to the old ways as this requires the knowledge of the old windows api calls. Which has specific OS types and classes.

My program is almost there , and knowing me, I like to use this program for my personal use and Im pretty sure others would like to use them as well.

So what now? I do have some basic knowledge of C/C++, but never ever done shell extensions before or COM which is like assembly language.

Wish me luck, cause Im about to dive in!

Helpful Links:



Programming: JQuery Questions

Recently been asked few programming questions, and the heck wasnt ready for those. The questions were 1. whats the difference between .parent() and closest() in JQuery, and surprise surprise I wasnt able to give an answer, all I can think about is parent(), is of course getting the parent of the element but wasnt sure whats the closest() function was. A simple search takes me to Traversing and there it is. I just had a look at the description and yep. closest(selector) takes an argument selector to look for the closest element and traverse to the tree all the way up the root html.

2. create a function isPalindrome($x), this one I just didnt know what palindrome means, went to search again and there it was, the term palindrome any text given and if reverse should be the exact same as the original. when I was cooking dinner.. just thought there might be a function the reverses the string and then match it against the original.meek .. too late.

3. (selector, selector, selector).fadeIn() how do you construct a function so they dont fade at the same time? Ugh another challenge when you are at the moment not using JQuery. Since I havent really delve into much in JQuery lately, top of my head just said just separate each one so they fade in order. Later that day I did a quick search “multiple selection”  and there it is the each() function, then I thought there must be a way to delay it for some milliseconds and there I went and look for the function there it was delay(milliseconds) chain them together with passing each(index) and voila .each(function(index) { $(this).delay(500*index).fadeIn(1000) }); would have been the answer again too late! lol

4. The last question I couldnt put together was to construct a regular expression, I can answer it but I just needed more time to pull up all my symbols expression using these: ^ $ * { } [] a-z 1-9 ? ! + ABC.  I know how to use them and what they means. Again out of time and too late.

Anyways Ive learned something new that day, which Im always happy about. Just so excited in the world of programming, I may not get a good result but it was definitely fun!

Identifying your weakness and strength

Howdy! We all have our strengths and weaknesses as a person and in our profession. You know yourself better than anyone else or maybe someone knows your better than yourself but most likely its yourself your biggest critic.

Its hard to admit that we have them. Its even harder when it shows and everybody notices it. For example Im not scared to admit one of my weaknesses is …. wait for it.

Im slow to pick up cues. I dont usually understand things that are new. I dont usually pick up jokes straight away, I cant even give a quick remarks back to someone being a smart ass. In all Im slow.

I identify it and proven, that is indeed a weakness or perhaps just part of how you as a person . Its just one of those weaknesses that its just there and can never be improved or fixed or maybe it can . So what do you do?

There is something you can do! Focus on your strength! I know Im slow, but I know that I am a also a critical thinker as well, what this makes you? It means you just dont go opening your mouth without thinking of the consequences, it means you never decide things on impulse, it means you analyze the situation as hard as you can to make  better decisions because you consider every options possible.

In this sense when one of your weakness shows up, there is one of your strength to help you out. Never forget the value that you have, identify your short comings if you can improve on them then yes improve on them, but never forget your strength its there to put you back up your feet.

This post is to just to remind us about learning to identify our own weaknesses, learn to accept them, know why you have them and finally how to do get pass them by identifying your strength!

Enter Git: Best way to learn git?

Hello, as a developer you need some sort of version control for your changes to your project or repository,handle them and work with colleagues as you do.

So meet Git, its a very straight forward tool I cannot give a well straight forward instruction but as a  beginner like you and me I found these video that can help us out. In summary these are the commands you will use from your day to day job using Git.

  • git config –global user.name “John Doe” and user.email “email@email” – this is for setting up an account
  • git init – starting your repository
  • git clone [url_to_the_repository] To download the repository to your current machine.
  • git reset –hard origin/master – This is to overwrite your local repository with your remote regardless, git status is up to date as this will destroy your local commits. Use it only if neccessary
  • git status – tell us that our working project are the same in the repository if not then use next command
  • git add .(all) or git add (filename) – you add the changes to the staging stage ready to be committed or made put the repository
  • git commit -m “Your message about the changes” – finally put your changes to the repository
  • git fetch – This will collect all the commits from your repository ready to be pulled.
  • git pull origin [master] – This will update your local repository from the master branch usually from the remote.
  • git add remote origin “https://repo.git” – This will add the link to your remote repository for consumption
  • git remove -v – This will display your current remote repository.
  • git checkout [branch-name] – This will set up your current branch , as Master is your main branch.
  • git log – these views any commits your team has made then add in –author “Beth” to see Beth’s commit message
  • git help – get help will show list of commands you can use and their usage
  • git diff – show the comparison , and show updates made from the old one, and remember this is before you do a commit. Otherwise there is nothing to show.
  • git diff –staged – compare your “staging” changes to your “repository” otherwise default is between “working” directory and the “repository”

Here is now the video you are waiting for, a very informative  tutorial that can get you started from beginner to advanced.

Credit to the video uploader. I learned alot from this tutorial. And I am sure you will too.

In another note, once you got a good grasp on Git. You might want to put your repository/project online then you know whats coming , GitHub! There’s other repo container out there but GitHub is like the standard. Anyways  thats it for now 🙂

2017 © Ideas, designs and algorithms