If you've ever had to write any interop code to use an unmanaged library in your C# application, you know how tricky it can be to get the data types correct. I often find myself scouring the internet looking for the correct conversions, so I thought I would document everything I have learned so far. This is by no means a comprehensive list of all C++ data types, just the ones I find myself frequently writing interop code for.
C++ Type | C# Type | Size |
---|---|---|
BOOL | bool | 1 byte |
BYTE | byte | 1 byte |
CHAR | byte | 1 byte |
DECIMAL | Decimal | 16 bytes |
DOUBLE | double | 8 bytes |
DWORD | uint, UInt32 | 4 bytes |
FLOAT | float, single | 4 bytes |
INT, signed int | int, Int32 | 4 bytes |
INT16, signed short int | short, Int16 | 2 bytes |
INT32, signed int | int, Int32 | 4 bytes |
INT64 | long, Int64 | 8 bytes |
LONG | int, Int32 | 4 bytes |
LONG32, signed int | int, Int32 | 4 bytes |
LONG64 | long, Int64 | 8 bytes |
LONGLONG | long, Int64 | 8 bytes |
SHORT, signed short int | short, Int16 | 2 bytes |
UCHAR, unsigned char | byte | 1 byte |
UINT, unsigned int | uint, UInt32 | 4 bytes |
UINT16, WORD | ushort, UInt16 | 2 bytes |
UINT32, unsigned int | uint, UInt32 | 4 bytes |
UINT64 | ulong, UInt64 | 8 bytes |
ULONG, unsigned long | uint, UInt32 | 4 bytes |
ULONG32 | uint, UInt32 | 4 bytes |
ULONG64 | ulong, UInt64 | 8 bytes |
ULONGLONG | ulong, UInt64 | 8 bytes |
WORD | ushort | 2 bytes |
void*, pointers | IntPtr | x86=4 bytes, x64=8 bytes |
If I am missing something, or you would like me to include something else, please let me know in the comments below. Thanks!
I am very happy to announce the release of FileSeek 1.9.6! I don't normally release new versions so close together, but an important issue was brought to my attention that couldn't wait until the next scheduled release date. This new version fixes a major issue with folder name matching when using the "include files filter". It should now work as expected, without skipping any folders. I also took this opportunity to include a couple of new features as well. The results list now shows each file's correct icon, instead of a generic icon. To make multiple-folder searches easier, there is now a "Browse & Append" button on the main window. If you use this button, the folder you select will be appended to your search path instead of replacing it.
If you would like to see the complete list of changes, please visit the FileSeek Change Log. I would encourage everyone to update to version 1.9.6 as soon as possible so that folder searching will start working as expected. Thanks everyone!
I am very happy to announce the release of FileSeek 1.9.5! This release adds a few requested options, as well as fixing some minor interface glitches. The biggest change is the addition of an option to toggle sub-folder searching. Now you can choose whether to search only the selected folder, or the folder and all sub-folders. Also, the FileSeek window will now remember it's last position and state between uses. This should make it much easier for anyone who frequently opens and closes FileSeek and has to keep moving the window around. To see the complete list of changes, please visit the FileSeek Change Log. Thanks everyone!
I am very happy to announce the release of TrayStatus 1.1! This new version of TrayStatus fixes a few hard drive monitoring issues, and adds a handy Settings window, instead of editing an INI file by hand. Do you have a notebook or keyboard without a NumLock or CapsLock indicator light? Do you have a computer without a hard drive activity light? If so, then TrayStatus is for you. I recently purchased a notebook that had no indicator lights at all, and after a couple of weeks I got frustrated and created TrayStatus. TrayStatus can show you the following information in your taskbar's notification area (system tray):
If you need to show this information in your taskbar, download the new version of TrayStatus today!
I am very happy to announce the release of DisplayFusion 3.1.8! Despite this being a small point release, it is jam-packed with new features and bug fixes. There's something for everyone! The official DisplayFusion Change Log contains a long, boring list of things that have changed, so I'll do my best to summarize the most exciting things here.
There are a pile of new features:
What a party! Of course, a new release wouldn't be complete without a generous helping of bug fixes as well. Let's take a look at some of the more important fixes:
I would encourage everyone to update to the new version today. If you are already a DisplayFusion Pro user, you have probably already downloaded and installed the new update automatically, because DisplayFusion Pro can do awesome things like that.
If you are using the Free version of DisplayFusion, and would like to help support the future development of DisplayFusion, please consider purchasing your very own DisplayFusion Pro license. It helps cover the cost of web hosting, bandwidth, development/testing/support time along with purchasing all of the crazy hardware needed to test DisplayFusion in different configurations.
Thanks everyone, and I hope you continue to enjoy DisplayFusion!