Click to See Complete Forum and Search --> : Exit from DLL loop by the event generated in VB


Jeong
August 23rd, 2001, 02:08 PM
In my program(VB code), call dll procedure(coded by C).
If click "stop" button in VB, must quit from the loop of DLL.
How can detect in dll(c code) whether "stop" button is clicked in VB?
In other words, even if control is passed to DLL, if VB generate some event, DLL must detect it?
Could anyone who know let me know the way?
Thanks.

I'm a senior programmer.
Working at CamSight, Dental imaging solutions industry.

berta
August 24th, 2001, 02:33 AM
sample API DLL C-code:

//function to export
long __stdcall myloopingfunction();
long __stdcall stopLoop();

static boolean _loop_flg;

long __stdcall myloopingfunction()
{
while(_loop_flg)
{
/*
loop code
for each loop U must call function to
Executes all pending Windows events.
(VB function DoEvents)
*/
}

return 0;

}

/* function to call in VB stop button */
long __stdcall stopLoop()
{
_loop_flg = false;
return 0;
}

hi brt