I have created an ActiveX Exe which instantiates an object, called 'plate', which behaves not unlike an 'oven'. Instead of cooking, it incubates for a specified duration. So, the client can call the 'incubate' method and go about its business. When the incubation period has elapsed, the plate object raises an event called "PlateReady". I've managed to implement this, and the PlateReady event gets received - however, it locks up the Client program, until it's ready - which to me defeats the purpose of having out-of-process components in the first place!
Here's what Incubate looks like
Public Sub Incubate()
'---------------------------------
Dim Units As Long
Dim Time As Integer
Dim TimeElapsed As Long
For Time = 0 To mlngIncubationTime Step 1000
'................................................................
DoEvents
Sleep (1000)
TimeElapsed = TimeElapsed + Time
RaiseEvent IncubationStatus(Str(TimeElapsed / 1000))
If TimeElapsed > mlngIncubationTime Then Exit For
'................................................................
Next Time
RaiseEvent PlateReady(mintIncubatorSlotIndex)
'---------------------------------
End Sub
The client program currently calls this method with a button click (which will be automated later) and it looks like this...
Private Sub cmdIncubate_Click()
'---------------------------------
DoEvents
Call TestPlate.Incubate
'---------------------------------
End Sub
Since The Plate object is formless, I have marked it for unattended execution, and I've tried both a thread pool and thread per object in its properties only to give the same result. The ultimate program will have to instantiate at least 30 of these plates as well as do a whole bunch of other stuff, which is why I'm doing this out-of-process.
Any ideas? (By the way, the Plate class' instancing property is set to Multi-Use).
Peace
Lego
"People have accused us of releasing the same album 16 times - that's simply not true. We've released the same album 17 times!" - Angus Young, AC/DC
Here's what Incubate looks like
Public Sub Incubate()
'---------------------------------
Dim Units As Long
Dim Time As Integer
Dim TimeElapsed As Long
For Time = 0 To mlngIncubationTime Step 1000
'................................................................
DoEvents
Sleep (1000)
TimeElapsed = TimeElapsed + Time
RaiseEvent IncubationStatus(Str(TimeElapsed / 1000))
If TimeElapsed > mlngIncubationTime Then Exit For
'................................................................
Next Time
RaiseEvent PlateReady(mintIncubatorSlotIndex)
'---------------------------------
End Sub
The client program currently calls this method with a button click (which will be automated later) and it looks like this...
Private Sub cmdIncubate_Click()
'---------------------------------
DoEvents
Call TestPlate.Incubate
'---------------------------------
End Sub
Since The Plate object is formless, I have marked it for unattended execution, and I've tried both a thread pool and thread per object in its properties only to give the same result. The ultimate program will have to instantiate at least 30 of these plates as well as do a whole bunch of other stuff, which is why I'm doing this out-of-process.
Any ideas? (By the way, the Plate class' instancing property is set to Multi-Use).
Peace
Lego
"People have accused us of releasing the same album 16 times - that's simply not true. We've released the same album 17 times!" - Angus Young, AC/DC