GetCurrentApplicationHandler is a function that returns the pointer to long. I cast it to (long*) pointer and display the value, which displays correctly the value returned by the function. Now I want to pass that value to another function. When I assign this value to returnValue(long) variable, and print it , it displays a garbage value, any ideas, what is missing in above code?