
07/06/2005, 06:11
|
| | Fecha de Ingreso: abril-2005
Mensajes: 3.083
Antigüedad: 20 años, 1 mes Puntos: 17 | |
Cita:
Iniciado por xaquin efectivamente, lo que quiero es que mi aplicación devuelva un valor, no saber si el mail llegó o no. Voy a probar lo de ExitProcess / TerminateProcess para ver si me funciona aunque estoy de acuerdo en que es una chapuza .... Es una chapuza porque hay que comprobar si está acabando la aplicación y la DLL de VB bien o se está preparando un follón que cause que alguna memoria no se libere, que alguna DLL se quede colgando o se cierre y cosas por el estilo: Cita:
Iniciado por MSDN Exiting a process causes the following:
1. All of the object handles opened by the process are closed.
2. All of the threads in the process, except the calling thread, terminate their execution. The entry-point functions of all loaded dynamic-link libraries (DLLs) are called with DLL_PROCESS_DETACH. After all attached DLLs have executed any process termination code, this function terminates the current process, including the calling thread.
3. The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate.
4. The states of all threads of the process become signaled, satisfying any threads that had been waiting for the threads to terminate.
5. The termination status of the process changes from STILL_ACTIVE to the exit value of the process.
If one of the terminated threads in the process holds a lock and the DLL detach code in one of the loaded DLLs attempts to acquire the same lock, then calling ExitProcess results in a deadlock. In contrast, if a process terminates by calling TerminateProcess, the DLLs that the process is attached to are not notified of the process termination. Therefore, if you do not know the state of all threads in your process, it is better to call TerminateProcess than ExitProcess. Note that returning from the main function of an application results in a call to ExitProcess. |