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 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!
I am very happy to announce the release of DisplayFusion 3.1.7! This new version brings a pile of changes and bug fixes along with it. It has more changes than any version since the main 3.1 release almost 6 months ago. It brings with it a completely overhauled Wallpaper window, a new Compatibility tab in the Settings window and more Context Menu options when right-clicking on a DisplayFusion Taskbar.
Here are some of the large new features:
There are some changes to existing features as well:
Of course, there are many important bug fixes as well:
Believe it or not, there are still dozens of other fixes and enhancements that made it into this release as well. If you would like to see the full list of changes, please visit the DisplayFusion Change Log. I would like to send out a huge Thank You to everyone who helped with this new version. From the hundreds of people who submitted bug reports and feature requests, to the dozens of beta testers in the DisplayFusion Forum, to the dozens of people who contribute to one of DisplayFusion's 25 different language translations. This new version wouldn't have been possible without you!
Some of the new features are for DisplayFusion Pro users only, like the application window edge snapping. If you are currently a DisplayFusion Free user and would like to help support this application, I would encourage you to check out what the Pro version has to offer. With Multi-Monitor Taskbars, random wallpaper changers, and enhanced TitleBar Button and HotKey support, the $25 Pro version is worth every penny. But, of course, I'm biased so why not try it out for free with a 30 day trial license.
I would encourage everyone to update to the new version today to take advantage of the increased performance, stability and new features. Thanks everyone!
Did you know there are more than a dozen hidden settings that you can use to configure DisplayFusion that aren't available in Settings window? There are 4 settings just to control the appearance of the taskbar thumbnail preview windows. You can adjust their size, delay, animation behaviour and toggle the tooltips. If you are using 4 or more monitors, you may want to change the order that DisplayFusion treats your monitors. With the advanced settings you can change this order. You can find out more about these hidden settings on the DisplayFusion Advanced Settings page. These settings are recommended only for people who are comfortable using regedit to edit their registry. If that is you, I encourage you to see how you can fully customize DisplayFusion.
Help us celebrate the New Year with a DisplayFusion sale! You can save 50% off any DisplayFusion purchase from now until Tuesday, January 5th. Visit the DisplayFusion Purchase page to view more information about the sale. This discount applies to any licenses purchased, including multi-license purchases and site licenses. Any site licenses that are quoted during the sale will be quoted at 50% off, and the quote will be honoured for up to 45 days. Here are some sample prices for different license quantities:
If you have been waiting for a good time to pickup some DisplayFusion licenses for your computers, now is your chance. You can buy 5 licenses at just $7.50 each, for a total of $37.50. That's under $40 for 5 licenses. This sale is only on until Tuesday, January 5th so don't delay!
Update: This sale is now done. Thanks for helping us ring in the New Year!