开发者

Custom windows form controls that could run on both 32bit (x86) and 64bit (x64) platform

I want to create custom windows form control that will be derived from existing winform controls. For e.g. TextBoxEx will deriv开发者_如何学编程e from System.Windows.Forms.TextBox. These new custom controls will change the look and feel and will add some extra capabilities to the existing control. This will be done by making appropriate win32 API calls.

I want to ensure that the developed custom controls work for both 32bit and 64bit platform. I would like to know the best way of achieving it on the basis of experiences (if any) of yours.


You don't have to do anything special. The underlying Windows API is the same irrespective of whether you are on 32 or 64 bit.

Data types that hold pointer sized things, e.g. window handles, float between 32 and 64 bit depending on which platform is targeted. For that reason they are declared as IntPtr for P/Invoke. So long as you get that right, your code will work on both platforms.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜