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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

activeX exe and Events

Status
Not open for further replies.

fenris

Programmer
May 20, 1999
824
CA
I am in the process of creating my first activeX exe which will become the basis for a project I have been working on.

The activex basically copies a file from a source to a destination. What I want to be able to do with this control is place multiple copies of it (via a control array) on a standard EXE and have some multithreaded file copying take place.

The only problem I am having right now is this:

If I place multiple copies of the activeX into a form and the controls are in a control array I don't know which control is done copying which file. I can "RaiseEvent" fileCopyingDone but I don't know how to reference the controls index value?

Would it work something like:

'declaration
Public Event fileCopyingDone(index as integer)

'implementation
RaiseEvent fileCopyingDone(me.index)

Eventually the fileCopyingDone event will be used to pull files that need to be copied from a que and I need to be able to assign new files to the controls that are finished so they can copy more.

I hope that this is clear......

Thanks in advance...

Troy Williams B.Eng.
fenris@hotmail.com

 
Hi

A quick-and-dirty solution to this is to parse the Ambient.DisplayName property. It will return the name of the usercontrol as it appears on the form [e.g. MyUsrCtrl(13)]. You can parse the index value and store it in Property or variable which can be used in any way you wish. There are more elegant ways of doing it but they involve more work. :)

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top