General information
Category:
ActiveX controls
Hello All,
I have a Dll that I need to interface to, it contains properties and methods for uploading XML strings to a database, all I have do to is build the XML strings and send it off to the Dll for uploading. The downside is that I have to wait for the property to finish before I get control back which in some cases could take more than 3-4 minutes.
To get around this problem someone told me that I could wrap the Dll in an ActiveX EXE and setup similair property and function names that are in the Dll. So in my main VB6.0 application I would talk to the ActiveX EXE wrapper and call the property or functions in it which in turn would invoke the corresponding property and functions in the Dll which would process the request and immediately return control back to the caller.
I tried to setup and example where I created a ActiveX DLL called delay that contains the following function:
Public Function Delay(ByVal fDelay As Single)
fDelay = Timer + fDelay
Do While (Timer < fDelay): DoEvents: Loop
End Function
I then created a ActiveX EXE wrapper:
Private moDelay As Delay.clsDelay
Public Function WrappedDelay(ByVal fDelay As Single)
moDelay.Delay fDelay
End Function
Private Sub Class_Initialize()
Set moDelay = New Delay.clsDelay
End Sub
Private Sub Class_Terminate()
Set moDelay = Nothing
End Sub
Please note that the wrapper references the Delay class
I then created Main application and invoked the wrapper class to perform the delay but it did not function the way I thought it would. I was expecting it to immediately return control while still processing the delay function.
The following is the code from the Main application:
Private moDelay As DelayWrapper.clsDelay
Private Sub Form_Load()
Set moDelay = New DelayWrapper.clsDelay
MsgBox "Before 5 Second Delay"
moDelay.WrappedDelay 5
MsgBox "After 5 Second Delay"
Set moDelay = Nothing
End Sub
Can someone please help me with this?
Thank You
Gary
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only