I updated the code for HookWatcher for more current versions of ProjectWise Explorer and the SDK.

You can find the updated source in the "Files" section of this forum.  This customization is only intended to be used by developers to "discover" which hooks are being called when menu or other commands are executed.  This is a custom module, so you first need to build the DLL and then register it with the Custom Module Manager.

I created this originally for myself as I was not good at guessing which hook, and sometimes more than one hook, was being called during actions such as updating document attributes, etc.

The list of hook ids and identifying text is as current as I could make it, but it does change from time to time, so when you get a new version of the SDK, be sure to update the list if there are changes.

Tested with VS 2019 C++, ProjectWise Explorer v 10.00.03.329, and ProjectWise SDK v10.00.03.262.

I hope that you find it useful!

Parents
  • Hi Dan,

    I tried your new HookWatcher (2021-12-01). When double clicking a dgn file in PW, Microstaiton CE is started up and the dgn is opened. So the HookWatcher catched the hooks, such as AAHOOK_OPEN_DOCUMENT, AAHOOK_EXECUTE_DOC_ACTION, AAHOOK_CHECKOUT_DOCUMENT and AAHOOK_START_APPLICATION, which is good. However, when closing this file in Microstation CE, the "Check in" window shows up, then click "Check in" to check in this dgn, the HookWatcher can't catch the hook, like "AAHOOK_CHECKIN_DOCUMENT", why? Thanks.

    Also, it seems this HookWatcher can only watch Hooks from ProjectWise Explorer, it can't catch actions by API, for example, I wrote an Microstation Addin to upload a dgn to a folder in ProjectWise, the Addin works fine, but the HookWatcher can't catch the upload action, i.e. create file or replace existing file in ProjecWise.

  • I suspect the answer here is that the HookWatcher addin/customisation is only running in the "Explorer" Application and the check-in dialog when closing the file is generated by the PW integration inside the "MicroStation" application. In comparison a check-in from PW Explorer (right click document --> check-in) would likely be captured in the HookWatcher. You might be able to load HookWatcher inside MicroStation if you modify it from CustReg.exe but I've not tried to do that myself.

  • Thanks Robert. Yeah, that's what I thought, the HookWatcher can only capture actions from Explorer. And good suggestion, I'll try to run it through MSTN.

Reply Children
No Data