|

楼主 |
发表于 2016-2-2 09:40:49
|
显示全部楼层
本帖最后由 topses 于 2016-2-2 09:50 编辑
matthew 作为VB开发小组的成员在下面已经把这个问题说得很明白.(即我一楼的传说2)
The problem with subclassing directly to an AddressOf procedure is that VB doesn't actually give you a function pointer to the code itself, but rather to a small thunk procedure. This procedure prevents you from running the AddressOf function when you're in break mode. This thunk is out of the picture after you compile your executable, but it wreaks havoc when you're in the IDE.
为什么 要使用代理(thunk), 因为 IDE 时是 P-CODE, 由 msvbvm60.dll 解释运行. 使用P-CODE的好处, 你可以在调试时, 修改代码后继续进行调试运行. 所以必须使用代理(thunk), 因为地址是有可能会变化, 所以在IDE时有时候会崩溃, 有时则不会. |
|