You seem to be confusing structure alignment (the byte packing stuff) with stack operations.
The #pragma pack(n) preprocessor directive specifies packing alignment for structure and union members. For example, for n having a value of 1, 2, 4, 8, or 16, each structure member after the first is stored on the smaller member type or n-byte boundaries.
Each occurrence of #pragma pack (push) stores the current packing alignment on an internal compiler stack. Each occurrence of #pragma pack (pop) retrieves the value at the top of an internal compiler stack and makes that value the new packing alignment.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
I have created a custom control which contains two buttons. I want these buttons to display the same arraows which are displayed on a scrollbars buttons. So, I create a font using the Marlett face name and instruct the button to use this font via WM_SETFONT. I also set the buttons text to "3" 4, 5 or 6 ( which maps to the arrows ). But the button still displays the number instead of the arrow. The marlett font doesn't contain any ASCII characters, it's all pictographs!
I have verified that the button is using the font via WM_GETFONT. Everything appears to be correct except that the arrows are not being displayed. Any clue as to what's gone wrong?
In my current project I want to convert a tiff file(*.tif) to a bitmap file(*.bmp) but I don't know how to do it.
Do you have any idea on how will I able to do it or knew a thread or post with this topic?
I have simple excel sheet in which i have 2 columns 1)employee name 2) employee id. All the columns having values is in sheet1. Now, my problem is i want to read my excel using code. i don't know how to do it. There are various articles using odbc but i don't want to use odbc. Can nybody tell me how to do it....
I want to convert char string to UTF-8.
How should I use int MultiByteToWideChar() and WideCharToMultiByte() to do such convertion?
And if I should not use the two function to resolve such task,but how should I do?
First use MultiByteToWideChar() to convert the char string from your local code page to wide char, then use WideCharToMultiByte() to convert the wide char string to UTF8. You may use CP_ACP for your local code page, and code page for utf-8 is 1200.
But I've never tried the conversion between wide char and utf-8, so I'm not sure whether it would succeed.