i' currently using visual C++ 6.0. i'm doing a program using dialog based (EXE). i try to loop a command using if and sleep, but it only run once. how to loop it? i have tried to place the command under IDOK and declare new function in the Dlg class. i also face a problem when pressing OK. the dialog close straight away. how to let the dialog still appear if i press OK, but close when i press exit. thanks for your advice.