How to transplant 32-bit C # projects to 64-bit XP or Vista?

xiaoxiao2021-04-02  251

First, let us celebrate, Win32's API is still, although Vista has come out of WPF to replace it. At 64, all APIs are commonly used, but should still pay attention to a few points:

1. According to the handle and pointers, it is expanded to 64. In order, this is nothing to say, or if there is 64 how to reflect? So inevitable, we have to adjust the items of 32 on the handle and pointer place. In the past, most people used int to replace the handle or pointer. In order to backward compatibility, it is best to change it to the INTPTR type, so later There is also a lot of worries, because INTPTR is also expanded into 64-bit in 64-bit.

2, try and intptr, because its extension is bound to have a small impact on your current project, especially "INTPTR", which is easy to cause the stack overflow, especially in our mouse message processing, Message.lparam is intptr, our usual practice uses loword and Hiword information, today weird discovery Today, I have to force the high 32-bit empty to 0, or it is directly transferred, I am willing to expand this place for MS, but I found that there will be inexplicable strange data in my debugging. Slowly explore later.

3, I found Size_T on Microsoft's 9CBS and expanded, but I have not found this problem in the middle of transplantation, I hope everyone will pay attention.

The above is a little experience today, I hope you can use it, thank you for your patronics!

If there is any mistake, I hope everyone will also point out!

Wangweixing2000

转载请注明原文地址:https://www.9cbs.com/read-131433.html

New Post(0)