Nukem9 / FaceFXWrapper

Utility to generate LIP files for TES/Fallout games.
MIT License
22 stars 7 forks source link

FaceFXWrapper is hanging when called from console #1

Closed siaccarino closed 2 years ago

siaccarino commented 3 years ago

Before you exit a program with an attached console you should

Example:

bool consoleAttached = false;
// Use command line processing instead
FILE* f1 = NULL, * f2 = NULL, * f3 = NULL;
if (AttachConsole(ATTACH_PARENT_PROCESS))
{
    f1 = freopen("CONIN$", "r", stdin);
    f2 = freopen("CONOUT$", "w", stdout);
    f3 = freopen("CONOUT$", "w", stderr);
    consoleAttached = true;
}
int result = run();
if (consoleAttached)
{
    fclose(f1);
    fclose(f2);
    fclose(f3);
    keybd_event(VK_RETURN, VK_RETURN, 0, 0);
    FreeConsole();
}
return result;
Nukem9 commented 2 years ago

Fixed! Thanks.