32bit vs 64bit Office - Ptrsafe function delcaration - when can I use it

后端 未结 1 2011
栀梦
栀梦 2021-01-29 02:44

We are moving from 32-bit to 64-bit Office products. This means that some of the VBA code throws errors if the function is not declared PtrSafe. I understand that I

1条回答
  •  盖世英雄少女心
    2021-01-29 03:16

    PtrSafe does not introduce any functionality. You cannot therefore say that something will or will not without it.

    PtrSafe is a flag with which you tell to the compiler, "I have verified that types I used for this API declaration are correct regardless of the pointer size".

    If you have verified that the types you are using are correct, put the PtrSafe. If you haven't, don't put it (and then it will not compile when there is a possibility of an error, that is, when the pointer size is not 32 bits).

    0 讨论(0)
提交回复
热议问题