Calling a function from .DLL, or calling C2 from .EXE

0 favourites
  • 6 posts
From the Asset Store
Medeival & Viking War Horns Sounds / 22 Unique Calls / 2:40 minutes of audio
  • Hello,

    Sorry for the crowded title. I want to do use Construct2 TTS, but the string I want to be read is generated by another program. Here is the scenario I have in mind:

    Construct2: Calls function F (with string parameter). F exists in a .DLL file.

    The .DLL file: Generates string S, and sends it to C2.

    .. and so on ..

    Is there a general method to do so ? I mean a method to send messages between C2 and local applications/.DLL

    Thank you.

  • You can pass commands to the CLI from Node Webkit. I think it is called Run application.

    https://www.scirra.com/manual/162/nwjs

  • The only problem is passing values to the exe or getting values back. You could use the clipboard for this but that's a bit hacky. Another option is using a file to return the data, but it's not ideal.

    Outside of that there appears to be plugin for nw.js to communicate with other dlls or you could make a plugin. The problem is, to do either you need to re-compile the nw executable, and unless you're very familiar with the process, it won't be easy.

    Would it be possible to make the program with js instead? That is if you made it. That way it's very doable to make a c2 addon that communicates with it.

  • Thank you very much for the help.

    I think the file method (using NW.js) will make it hard to know when a program edits a file. If the file is shared between the two processes, how does one know when the other is done editing ?

    The clipboard method seems clever! and the js seems promising might try them.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • With what we have access to I don't think we can know when a process is done with a file. The simplest solution would be to access the file after a set amount of time. Just be sure the program can finish before the c2 export accesses the file.

    The same idea could be applied to the clipboard idea.

  • Thank you, R0j0hound

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)