Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Polling for system messages

Status
Not open for further replies.

yumbelie

Programmer
Dec 31, 2002
96
GB
Hi,
I'm wondering how I poll for system messages from a 3rd party DLL?. Basically, I have a program which works out which files need to be added to a ZIP file, when it's worked it out - it passes to the ZIP compression library (XceedZIP) - which proceeds to zip the content. What I want to know tho, is how I can poll for these messages? As the code waits for the XceedZIP object to return control to the program before continuing to execute. I know how to subclass the form to allow me to poll for Windows Messages, but as the code halts while it waits for the ZIP operation to complete, I can't see how this will help. Quick sample:


Dim objZip As New XceedZip
Dim strResult As String

'Add files to ZIP objects 'To process' list
For x = 0 To UBound(FileArray)
With objZip
.AddToProcessFiles FileArray(x)
End With
Next x

objZip.Zip 'Invoke Compression - (Starts compressing)

MsgBox("All Done")


Basically the final line (in this simplified example) - MsgBox("All done") will not get executed until the objZip.Zip operation has completed.

The Xceed Zip object sends windows messages every time it adds 32K of stuff to the zip - but as I can't see how I poll for these, I can't see how I can update my form etc etc.

Any ideas greatly appericated.

Yum.
 
The XceedZip library exposes loads of events...

I would suggest that you do something a bit like this
Code:
Private WithEvents  objZip As XceedZip

public Sub Form_Load()
   Set objZip = New XceedZip
   ' Force Zip component to background process
   'its methods
   objZip.BackgroundProcessing = True
end sub

Public Sub ZipFiles()

Dim strResult As String

'Add files to ZIP objects 'To process' list 
For x = 0 To UBound(FileArray)
    With objZip
        .AddToProcessFiles FileArray(x)
    End With
Next x

objZip.Zip 'Invoke Compression - (Starts compressing)
'Need to monitor process using events
MsgBox("All Queued for zipping")

Don't forget to tidy up th eobjZip object when you are finished.






Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top