Yield (DoEvents) in a .DLL 
Author Message
 Yield (DoEvents) in a .DLL

Hello,

I've written a .DLL in Borland C++ version 4.52 (Win32) and it goes
through a looping process in the .DLL funtion I'm calling.  I'm calling
the .DLL from a Visual Basic program I've written.

My problem is this:

When I initiate the .DLL, it starts the looping process and never returns
control back to the Visual Basic program until after the whole looping
process finishes.  I need control to be passed back to my Visual Basic
program so that I can do other things while the .DLL is processing.

Is there a way to cause the .DLL to Yield control, similar to the DoEvents
statement in Visual Basic?  I've tried to call the Yield function in the
Windows.H file, but when it is called, the .DLL program blows up.  Why?
I use pointers in my .DLL program, so do I have to lock my data or stack
segments in LibMain?

Thank you VERY much for your help and insight into this problem...

--Roger



Thu, 26 Nov 1998 03:00:00 GMT  
 Yield (DoEvents) in a .DLL

How about

for(l = ??; l <= ??; l++)
   {

     // This makes the DLL a well behaved windows application
    // dynamic link library by yielding for other events
    if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
     {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
     }

    // What ever
   }

Roger



Thu, 26 Nov 1998 03:00:00 GMT  
 Yield (DoEvents) in a .DLL

<<How about

for(l = ??; l <= ??; l++)
   {

     // This makes the DLL a well behaved windows application
    // dynamic link library by yielding for other events
    if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
     {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
     }

    // What ever
   }

Roger >>

Thank you very much, Roger.  I appreciate it!

--Roger



Fri, 27 Nov 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HOWTO: a replacement for Doevents which does not yield to keystrokes

2. VB 5.0 BUG RaiseEvent Yields execution as DoEvents !!!!!!

3. VB 5.0 BUG RaiseEvent Yields execution as DoEvents !!!!!!

4. 'DoEvents' inside ActiveX DLL

5. Acc20: Working Querydef's SQL Property Yields Unsupported Join Expression

6. Week number to yield dates?

7. OnAction yields no action

8. How? Yield to function before exectuting other code

9. DAO in VB5 yields User-defined type not defined

10. SELECT DISTINCT yields more than SELECT

11. Sleep() or Yield() ?

12. Making an ActiveX control yield

 

 
Powered by phpBB® Forum Software