Forum
    • Categories
    • Register
    • Login

    How to add a custom C++ method to Engine scripting API?

    Scheduled Pinned Locked Moved General Questions
    2 Posts 2 Posters 54 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pcs800P
      pcs800
      last edited by

      I'm building a compiled VST3 plugin with HISE and need to call a Windows API function (CreateMutexA) from HiseScript to detect whether a specific host DAW is running. I'm building HISE from source in Visual Studio 2022.
      I tried adding the method to ScriptingApi.cpp and ScriptingApi.h following the existing getName() pattern, but including windows.h at the top of ScriptingApi.cpp causes a Rectangle macro conflict that breaks compilation.
      What is the correct way to either (1) include windows.h safely in ScriptingApi.cpp, or (2) add a custom Engine method that calls a Windows API function?

      HISEnbergH 1 Reply Last reply Reply Quote 0
      • HISEnbergH
        HISEnberg @pcs800
        last edited by

        @pcs800 There is a bit of documentation about it here:

        https://docs.hise.dev/cpp_api/index.html#create-your-own-classes

        I think this discussion may help:

        https://forum.hise.audio/topic/12951/procedure-for-writing-our-own-api-for-hisescript

        Best advice here is just to follow and copy the patterns found in the HISE source code already. One thing to note, if you are trying to detect if a specific DAW is running, that's definitely a JUCE task. Does JUCE have a function for detecting your specific DAW? If not then you need to modify the JUCE source code (PluginSourceType) , then mirror that in HISE.

        Sonic Architect && Software Mercenary

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        13

        Online

        2.2k

        Users

        13.6k

        Topics

        118.0k

        Posts