Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FaceFXWrapper is hanging when called from console #1

Closed
siaccarino opened this issue Oct 29, 2021 · 1 comment
Closed

FaceFXWrapper is hanging when called from console #1

siaccarino opened this issue Oct 29, 2021 · 1 comment

Comments

@siaccarino
Copy link

siaccarino commented Oct 29, 2021

Before you exit a program with an attached console you should

  • send a return key to the console
  • Free the console

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 Nukem9 closed this as completed in 85a0f2a Dec 8, 2021
@Nukem9
Copy link
Owner

Nukem9 commented Dec 8, 2021

Fixed! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants