I want to create custom windows form control that will be derived from existing winform controls. For e.g. TextBoxEx will derive 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.
我希望创建自定义的windows窗体控件,该控件将从现有的winform控件派生。例如,TextBoxEx将从system . windows . form . textbox派生出来。这些新的自定义控件将改变外观,并向现有控件添加一些额外的功能。这将通过适当的win32 API调用来实现。
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.
我希望确保所开发的自定义控件在32位和64位平台上都能工作。我想知道以你的经验(如果有的话)来实现它的最好方法。
1 个解决方案
#1
1
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.
你不需要做什么特别的事情。底层Windows API是相同的,不管您是在32位还是64位上。
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.
保存指针大小的数据类型,例如窗口句柄,根据目标平台的不同浮动在32到64位之间。由于这个原因,它们被声明为P/Invoke的IntPtr。只要你做对了,你的代码就可以在两个平台上运行。
#1
1
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.
你不需要做什么特别的事情。底层Windows API是相同的,不管您是在32位还是64位上。
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.
保存指针大小的数据类型,例如窗口句柄,根据目标平台的不同浮动在32到64位之间。由于这个原因,它们被声明为P/Invoke的IntPtr。只要你做对了,你的代码就可以在两个平台上运行。