Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

394
Visualizações
_popen opens terminal for a split second c++

I have a server/client program. My client uses _popen to execute commands. When I send a command from server to client, my client opens a new terminal(cmd) and then closes it. All of this happens within a second.

I don't want my client program to open and close a terminal when executing a command. I don't want any terminal when I execute a command on my client with _popen. How can I prevent that my client opens a new terminal?

Client:

FILE* f = _popen(command, "r");
if (f == NULL)
{
    printf("error _popen 2\n");
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Maybe popen() isn't what you need. Take a look at the _spawn family of functions (https://docs.microsoft.com/en-us/cpp/c-runtime-library/spawn-wspawn-functions), maybe that's what you're looking for?

There are also some cross-platform C libraries out there for executing other programs, that already invented the wheel you are trying to reinvent. For example:

  • https://github.com/DaanDeMeyer/reproc
  • https://github.com/brechtsanders/crossrun
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda