Creating a simple data visualizer

I compiled the code I posted above and it works OK today:

The only change I made was to switch it from using the static C runtime (since I'm using VS2022 and don't have the new CRT DLLs on the machine I was testing on):

No other changes were needed. I left the workaround code in to avoid complicating things. That should only be removed after confirming the original code works, in case removing it is what breaks things.

Looking at your code, you're passing an ASCII string while my code is passing UTF-16 with a BOM. Jon mentioned he has just made some changes so that ASCII/UTF-8 should work better here without needing a BOM, but I don't know if that is what's causing your issue, or something else.

Some detail on what is actually working and failing would be helpful here, as otherwise I'm having to guess with no idea if the DLL is even loading on your system.

Have you checked which functions (if any) are being called?

What is actually failing?

What are the error values?

1 Like

Hmmm this is interesting.

Let me try this from scratch.

  1. I downloaded from above.

  2. Opened in Visual Studio. I'm Using VS2017 15.9.36

  3. Edited the properties of the project, since the given Windows SDK (10.0.15063.0) isn't installed here. I changed it to 10.0.17763.0:

  4. I build the solution without any code changes.

1>------ Build started: Project: ZPatchViewer, Configuration: Debug x64 ------
1>   Creating library C:\Users\Felipe\Desktop\ZPatchViewer_a2_leo\x64\Debug\ZPatchViewer.lib and object C:\Users\Felipe\Desktop\ZPatchViewer_a2_leo\x64\Debug\ZPatchViewer.exp
1>ZPatchViewer.vcxproj -> C:\Users\Felipe\Desktop\ZPatchViewer_a2_leo\x64\Debug\ZPatchViewer.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
  1. I closed Directory Opus.

  2. I copied the resulting DLL to C:\Program Files\GPSoftware\Directory Opus\Viewers using a admin powershell console.

  3. I started Directory Opus. Got the message box with DVP_Identify as expected.

  4. I select a zpatch file and get this:

  5. Just to be sure, I try the same with the .txt file I created to test:

  6. If I attach the debugger and set a breakpoint in the first line of DVP_LoadText() and deselect and re-select the zpatch, I can walk through it and everything seems to be working as intended.

The only other thing that I forgot to mention before is that I'm running Windows 11, as you can see with the rounded corners of the windows in the screenshots.

If you noticed anything wrong in the steps I took, please let me know :slight_smile:


Does turning off Preferences / Viewer / Viewer Pane / Display shell icons make a difference?

Unfortunately, no, same behavior :frowning:

My fault. It turns out it only worked for me because I was using a version with Jon's recent changes in. I went back to the beta from Sunday and it no longer worked. I didn't think those were needed for the old code to work, but it looks like they are.

So things should work again once we release the next beta version.

I'm also posting a zip with the source, a compiled DLL (VS2022, static CRT), and the test file all in one place to avoid having to search the thread for the different parts:

ZPatchViewer_a2_leo_vs2022.7z (5.8 MB)

1 Like

Quick update about this: I added an update to the plugin in GitHub, if someone ever stumble about this thread and wants a working plugin example.

@Leo, I checked the file you attached, and it still includes the Kludge fix for Opus 12.6. The plugin works without it.
I thought it would be good to mention it, since it writes to an area of the memory that it shouldn't.

Thank you again for all your help! :slight_smile: