OfficialIncubo / BeatDrop-Music-Visualizer

The Milkdrop2 Music Visualization Standalone, only for Windows
https://twitter.com/BeatDropVis
Other
34 stars 2 forks source link

Windows 7 - Entry Point Not Found #21

Closed OfficialIncubo closed 7 months ago

OfficialIncubo commented 8 months ago

I just installed BeatDrop on the old laptop from 2013 and I tried to run, but the error appeared right there. 20231106_072016.jpg

Laptop: Acer Aspire E1-531 OS: Windows 7 Professional

I have pasted USER32.dll in the BeatDrop folder and still didn't work. Is there a solution to solve this?

EDIT: I think it doesn't work on the older Windows versions, e.g. Windows XP.

EDIT 2: The code that happens will be right there

EDIT 3: I tried on another Windows 7 laptop and in the version v1.2.4 did work then, but idk why the version 1.3 didn't work?

OfficialIncubo commented 8 months ago

With the old SetPerMonitorAwarness code, it did work again, but can you please explain why the new SetPerMonitorAwareness code don't work while running BeatDrop, @leadedge? 20231106_105354.jpg

EDIT: BeatDrop's Spout Sender still works on Windows 7 with no problem.

leadedge commented 8 months ago

In Visual Studio you can use -

Project properties > Manifest Tool > Input and Output > DPI Awareness > Per Monitor High DPI Aware

or just leave it out.

OfficialIncubo commented 8 months ago

In Visual Studio you can use -

Project properties > Manifest Tool > Input and Output > DPI Awareness > Per Monitor High DPI Aware

I changed from None to Per Monitor High DPI Aware, so I think your solution will work. It will take about 15-45 minutes to test it again with this setting. If it works, then I'll re-release it.

OfficialIncubo commented 8 months ago

@leadedge, still didn't work. Even changed the DPI Awareness to Per Monitor High DPI Aware. 20231106_154726.jpg So, I think I can keep the old SetPerMonitorAwareness code.

leadedge commented 8 months ago

"SetProcessDpiAwareness" or "SetProcessDpiAwarenessContext" are not needed with the Visual Studio settings.

Edit

Here is the Microsoft information

There are three functions depending on the operating system. You only need these or the manifest method if the compiler does not have the dpi setting.

Edit 2

I tested this with the current Beatdrop project and, although the Visual Studio project settings normally work fine, they are not effective for this particular program. I found some older comments in Plugin.cpp .

29.04.19   Noted : setting  Monitor dpi awareness uusing Manifest tool compiler option
results in blurry text for the console window. Retained SetProcessDpiAwareness.
29.10.19   - Milkdrop2PcmVisualizer.cpp
Change dpi awareness to use SetProcessDpiAwarenessContext for Windows 7 compatibility
Remove #include <ShellScalingApi.h> and #pragma comment(lib, "shcore.lib")

So if going back to "SetProcessDpiAwareness" solves the problem it should be enough. But Microsoft say that this is only available for Windows 8.1 and higher and "SetProcessDPIAware" is used for Windows 7.

There is already a manifest file and I have had no success in modifying it. If you still have trouble with Windows 7, it might be possible to select depending on the Windows build number.

    char build[128]={};
    if (ReadPathFromRegistry(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "CurrentBuildNumber", build, 128)) {
        if (atoi(build) >= 14393)
            SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); // Windows 10
        else if (atoi(build) >= 9600)
            SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); // Windows 8.1
        else if (atoi(build) >= 6002)  // Windows 7, Windows Vista
            SetProcessDPIAware();
    }
OfficialIncubo commented 8 months ago

I took a look in your comment.

leadedge commented 8 months ago

According to Microsoft SetProcessDPIAware - Windows Vista (NT 6.0, build 6002) SetProcessDpiAwareness - Windows 8.1 (NT 6.3, build 9600) SetProcessDpiAwarenessContext Windows 10 (version 1607, build 14393)

Probably Windows XP did not have dpi scaling because monitors were relatively low resolution then.

The code can above can be inserted at line 512. Comment out line 510 for SetProcessDpiAwareness. The code builds and works for Windows 10 but I can't test with any other Windows version. It should work as long as the build numbers are correct

OfficialIncubo commented 8 months ago

I'll do that later ;)

Probably Windows XP did not have dpi scaling because monitors were relatively low resolution then.

Hmmmm... Oh. I see. I think I try Windows XP with the Virtual Machine, same for Windows 7 (non-VM cuz I have it) to see if it works with the latest implementation. ....or it shouldn't work with Windows XP either. I have about 35GB left on my laptop and almost don't have a mem space, so what memory space are recommended for VM (Virtual Machine) and Windows XP .iso file?

leadedge commented 8 months ago

I don't know. You might be lucky.

OfficialIncubo commented 8 months ago

With the changed implementation... 20231107_161031.jpg ...still got an error. I have Windows Build 7601, then it lead to "SetProcessDPIAware" when I ran BeatDrop. Even set to Per Monitor High DPI Aware. 20231107_160604.jpg Another solution? If not, then I'll keep the old SetPerMonitorAwareness code.

Sorry for spamming the same error again.

leadedge commented 8 months ago

SetProcessDpiAwarenessContext was used to keep aligned with Microsoft recommendations. It gives more options but they are not used anyway. So removing it will not have any effect. If you have further trouble with Windows 7 you could look at the version helper functions instead of the registry.

OfficialIncubo commented 8 months ago

@leadedge, Again and again. Still happened an error, even with Version Helpers. 20231111_120318.jpg 20231111_120036.jpg I think I'll keep the old SetPerMonitorAwareness code, so that will make support for Windows 7. Please check the new Show and Tell discussion how did it work with the old SetPerMonitorAwareness code.

leadedge commented 8 months ago

SetProcessDpiAwareness is WIndow8 or above and should fail for WIndows 7. The helper functions are only useful if you want to support Windows 7 as I understood you were trying to do.

As previously, SetProcessDpiAwareness will be OK for Windows 10 because SetProcessDpiAwarenessContext just adds more options but does not replace it.

OfficialIncubo commented 8 months ago

@leadedge Alr. I clarified this, but idk why it jumps directly to SetProcessDpiAwarenessContext, even using version helpers.

I think I'll keep the old SetProcessDpiAwareness code cuz I tried it and it worked. I'll close it as unplanned. I recommend you to try Windows 7 in a Virtual Machine with the latest SetProcessDpiAwareness code. Download the source code, Include versionhelpers.h on Milkdrop2PcmVisualizer.cpp, paste the code at line 512, comment the line 150, build it and see if it works.

Code:

if (IsWindows10OrGreater())
            SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); // Windows 10
        else if (IsWindows8Point1OrGreater())
            SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); // Windows 8.1
        else if (IsWindows7OrGreater())  // Windows 7, Windows Vista
            SetProcessDPIAware();

If it doesn't work, you can try to find another solution, then tell me.

OfficialIncubo commented 8 months ago

Hey! @leadedge! You can still reply in this issue if it's closed as not planned? Did you try BeatDrop with the new SetProcessDpiAwarenessContext in a Windows 7 VM?

leadedge commented 8 months ago

Sorry that I don't have time to set up the VM. The helper functions should set "SetProcessDPIAware() " for Windows 7. Perhaps leave what you have working and look into it if anybody has trouble.

OfficialIncubo commented 7 months ago

Yeah. I think I'll close as completed because it worked with Windows 7 (Yes! I tried on every computer with the same OS) with the old SetPerMonitorAwareness code.