Good afternoon I'm developing an application that needs to be sure that the document was printed on the bematech thermal printer MP-4200 TH, as the printer has buffer even if it has no paper in it, it sends the command to the printer and returns as ok , so I can not know if it was actually printed or just sent to printer, verifying the class has a function that according to the documentation makes the application wait for the end of the printout.
/// <summary>
/// Esta função segura a execução do Aplicativo, até que todo o texto enviado seja impresso.
/// </summary>
/// <param name="modo">INTEIRO modo de espera.</param>
/// <returns>INTEIRO - Indica se a função conseguiu enviar o comando para impressora.</returns>
[DllImport("MP2032.dll")]
public static extern int EsperaImpressao(int modo);
However this is not working by returning it unbalanced the stack.