A Problem in Using the Suggested Gif Animation ocx

yahya
11-21-2001, 06:33 AM
Hi all,

I have downloaded the AnimatedGif ocx from this forum (the one provided by "The Hand" and I am facing a problem using it.

The project I'm working on is an email broadcasting tool. I am using ASPEmail object to send the emails.

I want to have an animated gif on the form while the tool is sending the emails. The problem is that the animation pauses at the sending command "objASPMail.Send" which is the main time consuming command. The result is an image that moves one frame every 5 seconds or more.

I have tryed to use "DoEvents" before the "objASPMail.Send" and after it but it did not work. I have also tryed to use a timer object which also did not work.

Can anyone help?

P.S. I've attached the gif file.

Yahya

Banjo
11-21-2001, 06:54 AM
The only way around this problem is if the ASPMail object allows you to setup a callback functions. You can then call DoEvents in the callback (not to mention providing a progress bar!). I'm afraid that I'm not familiar with the ASPMail library so I can't give you details.

You seem to misunderstand what DoEvents does. At the moment you call it, it yields control from the current thread. This allows other threads in your process (ie, AX controls and DLLs) time to execute. Because the Send Method is modal there is no place to call Doevents, hence the need for a callback.

Just another thought, if you declare objASPMail at module level WithEvents you may find it has a standard event available.

Ad1
11-21-2001, 06:55 AM
maybe try multithreading it by putting the mailsend commands into a seperate activex dll, which will return a value to tell you when it is done

yahya
11-21-2001, 07:18 AM
Hi Banjo,

Can you please elaborate on the callback idea. I am not familier with it. What is it and how can I know if it is available with ASPEMail?

Thanks

Banjo
11-21-2001, 07:39 AM
Basically the class will have a property into which you pass the address of a function. The prototype for this function will be defined in the documentation for the class. You supply the address with the AddressOf keyword (note that this works in VB6 and possibly VB5 only). E.g.:

objASPMail.fnCallback = AddressOf fnMailCallback

Where fnMailCallback is a sub or function defined in a module in your program. It must be a module because the memory in which it resides must be accessable to the whole process and form or object memory isn't.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum